Skip to content

Files

Latest commit

 

History

History
25 lines (15 loc) · 690 Bytes

File metadata and controls

25 lines (15 loc) · 690 Bytes

Pattern: Malformed arguments for formatting method

Issue: -

Description

The format string argument passed to a method such as WriteLine, Write, or System.String.Format does not contain a format item that corresponds to each object argument, or vice versa.

By default, this rule only analyzes calls to the three methods mentioned previously, but this is configurable.

Example of incorrect code:

Console.WriteLine(string.Format("{0}", file, errors));

Example of correct code:

Console.WriteLine(string.Format("{0}", file));

Further Reading