C#: Add more format testcases.

This commit is contained in:
Michael Nebel
2025-04-04 15:48:43 +02:00
parent 327ddb07a1
commit 175e4ecb74
2 changed files with 119 additions and 54 deletions

View File

@@ -72,6 +72,7 @@ class FormatInvalid
Format("}", 0);
// BAD: All of these are format methods with an invalid string.
String.Format("}"); // $ Alert
String.Format("}", 0); // $ Alert
String.Format("}", ps); // $ Alert
String.Format(fp, "}", ps); // $ Alert
@@ -79,6 +80,7 @@ class FormatInvalid
String.Format("}", 0, 1, 2); // $ Alert
String.Format("}", 0, 1, 2, 3); // $ Alert
sb.AppendFormat("}"); // $ Alert
sb.AppendFormat("}", 0); // $ Alert
sb.AppendFormat("}", ps); // $ Alert
sb.AppendFormat(fp, "}", ps); // $ Alert
@@ -117,6 +119,19 @@ class FormatInvalid
System.Diagnostics.Debug.Print("}", ps); // $ Alert
Console.WriteLine("}"); // GOOD
// The Following methods are not recognised as format methods.
Console.WriteLine("{0}"); // GOOD
Console.Write("{0}"); // GOOD
tw.WriteLine("{0}"); // GOOD
tw.Write("{0}"); // GOOD
System.Diagnostics.Debug.Print("{0}"); // GOOD
System.Diagnostics.Debug.WriteLine("{0}"); // GOOD
System.Diagnostics.Debug.Write("{0}"); // GOOD
System.Diagnostics.Trace.TraceError("{0}"); // GOOD
System.Diagnostics.Trace.TraceInformation("{0}"); // GOOD
System.Diagnostics.Trace.TraceWarning("{0}"); // GOOD
ts.TraceInformation("{0}"); // GOOD
}
System.IO.StringWriter sw;

View File

@@ -7,40 +7,49 @@
| FormatInvalid.cs:42:23:42:28 | "{0}}" | FormatInvalid.cs:42:23:42:28 | "{0}}" | FormatInvalid.cs:42:23:42:28 | "{0}}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:42:9:42:35 | call to method Format | this | FormatInvalid.cs:42:9:42:35 | call to method Format | this |
| FormatInvalid.cs:45:23:45:32 | "{foo{0}}" | FormatInvalid.cs:45:23:45:32 | "{foo{0}}" | FormatInvalid.cs:45:23:45:32 | "{foo{0}}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:45:9:45:36 | call to method Format | this | FormatInvalid.cs:45:9:45:36 | call to method Format | this |
| FormatInvalid.cs:51:23:51:28 | "}{0}" | FormatInvalid.cs:51:23:51:28 | "}{0}" | FormatInvalid.cs:51:23:51:28 | "}{0}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:51:9:51:32 | call to method Format | this | FormatInvalid.cs:51:9:51:32 | call to method Format | this |
| FormatInvalid.cs:75:23:75:25 | "}" | FormatInvalid.cs:75:23:75:25 | "}" | FormatInvalid.cs:75:23:75:25 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:75:9:75:29 | call to method Format | this | FormatInvalid.cs:75:9:75:29 | call to method Format | this |
| FormatInvalid.cs:76:23:76:25 | "}" | FormatInvalid.cs:76:23:76:25 | "}" | FormatInvalid.cs:76:23:76:25 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:76:9:76:30 | call to method Format | this | FormatInvalid.cs:76:9:76:30 | call to method Format | this |
| FormatInvalid.cs:77:27:77:29 | "}" | FormatInvalid.cs:77:27:77:29 | "}" | FormatInvalid.cs:77:27:77:29 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:77:9:77:34 | call to method Format | this | FormatInvalid.cs:77:9:77:34 | call to method Format | this |
| FormatInvalid.cs:78:23:78:25 | "}" | FormatInvalid.cs:78:23:78:25 | "}" | FormatInvalid.cs:78:23:78:25 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:78:9:78:32 | call to method Format | this | FormatInvalid.cs:78:9:78:32 | call to method Format | this |
| FormatInvalid.cs:79:23:79:25 | "}" | FormatInvalid.cs:79:23:79:25 | "}" | FormatInvalid.cs:79:23:79:25 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:79:9:79:35 | call to method Format | this | FormatInvalid.cs:79:9:79:35 | call to method Format | this |
| FormatInvalid.cs:80:23:80:25 | "}" | FormatInvalid.cs:80:23:80:25 | "}" | FormatInvalid.cs:80:23:80:25 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:80:9:80:38 | call to method Format | this | FormatInvalid.cs:80:9:80:38 | call to method Format | this |
| FormatInvalid.cs:82:25:82:27 | "}" | FormatInvalid.cs:82:25:82:27 | "}" | FormatInvalid.cs:82:25:82:27 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:82:9:82:31 | call to method AppendFormat | this | FormatInvalid.cs:82:9:82:31 | call to method AppendFormat | this |
| FormatInvalid.cs:83:25:83:27 | "}" | FormatInvalid.cs:83:25:83:27 | "}" | FormatInvalid.cs:83:25:83:27 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:83:9:83:32 | call to method AppendFormat | this | FormatInvalid.cs:83:9:83:32 | call to method AppendFormat | this |
| FormatInvalid.cs:84:29:84:31 | "}" | FormatInvalid.cs:84:29:84:31 | "}" | FormatInvalid.cs:84:29:84:31 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:84:9:84:36 | call to method AppendFormat | this | FormatInvalid.cs:84:9:84:36 | call to method AppendFormat | this |
| FormatInvalid.cs:85:25:85:27 | "}" | FormatInvalid.cs:85:25:85:27 | "}" | FormatInvalid.cs:85:25:85:27 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:85:9:85:34 | call to method AppendFormat | this | FormatInvalid.cs:85:9:85:34 | call to method AppendFormat | this |
| FormatInvalid.cs:86:25:86:27 | "}" | FormatInvalid.cs:86:25:86:27 | "}" | FormatInvalid.cs:86:25:86:27 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:86:9:86:37 | call to method AppendFormat | this | FormatInvalid.cs:86:9:86:37 | call to method AppendFormat | this |
| FormatInvalid.cs:87:25:87:27 | "}" | FormatInvalid.cs:87:25:87:27 | "}" | FormatInvalid.cs:87:25:87:27 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:87:9:87:40 | call to method AppendFormat | this | FormatInvalid.cs:87:9:87:40 | call to method AppendFormat | this |
| FormatInvalid.cs:89:27:89:29 | "}" | FormatInvalid.cs:89:27:89:29 | "}" | FormatInvalid.cs:89:27:89:29 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:89:9:89:33 | call to method WriteLine | this | FormatInvalid.cs:89:9:89:33 | call to method WriteLine | this |
| FormatInvalid.cs:90:27:90:29 | "}" | FormatInvalid.cs:90:27:90:29 | "}" | FormatInvalid.cs:90:27:90:29 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:90:9:90:34 | call to method WriteLine | this | FormatInvalid.cs:90:9:90:34 | call to method WriteLine | this |
| FormatInvalid.cs:91:27:91:29 | "}" | FormatInvalid.cs:91:27:91:29 | "}" | FormatInvalid.cs:91:27:91:29 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:91:9:91:36 | call to method WriteLine | this | FormatInvalid.cs:91:9:91:36 | call to method WriteLine | this |
| FormatInvalid.cs:92:27:92:29 | "}" | FormatInvalid.cs:92:27:92:29 | "}" | FormatInvalid.cs:92:27:92:29 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:92:9:92:39 | call to method WriteLine | this | FormatInvalid.cs:92:9:92:39 | call to method WriteLine | this |
| FormatInvalid.cs:93:27:93:29 | "}" | FormatInvalid.cs:93:27:93:29 | "}" | FormatInvalid.cs:93:27:93:29 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:93:9:93:42 | call to method WriteLine | this | FormatInvalid.cs:93:9:93:42 | call to method WriteLine | this |
| FormatInvalid.cs:95:22:95:24 | "}" | FormatInvalid.cs:95:22:95:24 | "}" | FormatInvalid.cs:95:22:95:24 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:95:9:95:28 | call to method WriteLine | this | FormatInvalid.cs:95:9:95:28 | call to method WriteLine | this |
| FormatInvalid.cs:96:22:96:24 | "}" | FormatInvalid.cs:96:22:96:24 | "}" | FormatInvalid.cs:96:22:96:24 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:96:9:96:29 | call to method WriteLine | this | FormatInvalid.cs:96:9:96:29 | call to method WriteLine | this |
| FormatInvalid.cs:97:22:97:24 | "}" | FormatInvalid.cs:97:22:97:24 | "}" | FormatInvalid.cs:97:22:97:24 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:97:9:97:31 | call to method WriteLine | this | FormatInvalid.cs:97:9:97:31 | call to method WriteLine | this |
| FormatInvalid.cs:98:22:98:24 | "}" | FormatInvalid.cs:98:22:98:24 | "}" | FormatInvalid.cs:98:22:98:24 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:98:9:98:34 | call to method WriteLine | this | FormatInvalid.cs:98:9:98:34 | call to method WriteLine | this |
| FormatInvalid.cs:99:22:99:24 | "}" | FormatInvalid.cs:99:22:99:24 | "}" | FormatInvalid.cs:99:22:99:24 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:99:9:99:37 | call to method WriteLine | this | FormatInvalid.cs:99:9:99:37 | call to method WriteLine | this |
| FormatInvalid.cs:101:44:101:46 | "}" | FormatInvalid.cs:101:44:101:46 | "}" | FormatInvalid.cs:101:44:101:46 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:101:9:101:51 | call to method WriteLine | this | FormatInvalid.cs:101:9:101:51 | call to method WriteLine | this |
| FormatInvalid.cs:102:45:102:47 | "}" | FormatInvalid.cs:102:45:102:47 | "}" | FormatInvalid.cs:102:45:102:47 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:102:9:102:51 | call to method TraceError | this | FormatInvalid.cs:102:9:102:51 | call to method TraceError | this |
| FormatInvalid.cs:103:51:103:53 | "}" | FormatInvalid.cs:103:51:103:53 | "}" | FormatInvalid.cs:103:51:103:53 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:103:9:103:57 | call to method TraceInformation | this | FormatInvalid.cs:103:9:103:57 | call to method TraceInformation | this |
| FormatInvalid.cs:104:47:104:49 | "}" | FormatInvalid.cs:104:47:104:49 | "}" | FormatInvalid.cs:104:47:104:49 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:104:9:104:53 | call to method TraceWarning | this | FormatInvalid.cs:104:9:104:53 | call to method TraceWarning | this |
| FormatInvalid.cs:105:29:105:31 | "}" | FormatInvalid.cs:105:29:105:31 | "}" | FormatInvalid.cs:105:29:105:31 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:105:9:105:35 | call to method TraceInformation | this | FormatInvalid.cs:105:9:105:35 | call to method TraceInformation | this |
| FormatInvalid.cs:107:23:107:25 | "}" | FormatInvalid.cs:107:23:107:25 | "}" | FormatInvalid.cs:107:23:107:25 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:107:9:107:29 | call to method Write | this | FormatInvalid.cs:107:9:107:29 | call to method Write | this |
| FormatInvalid.cs:108:23:108:25 | "}" | FormatInvalid.cs:108:23:108:25 | "}" | FormatInvalid.cs:108:23:108:25 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:108:9:108:32 | call to method Write | this | FormatInvalid.cs:108:9:108:32 | call to method Write | this |
| FormatInvalid.cs:109:23:109:25 | "}" | FormatInvalid.cs:109:23:109:25 | "}" | FormatInvalid.cs:109:23:109:25 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:109:9:109:35 | call to method Write | this | FormatInvalid.cs:109:9:109:35 | call to method Write | this |
| FormatInvalid.cs:110:23:110:25 | "}" | FormatInvalid.cs:110:23:110:25 | "}" | FormatInvalid.cs:110:23:110:25 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:110:9:110:38 | call to method Write | this | FormatInvalid.cs:110:9:110:38 | call to method Write | this |
| FormatInvalid.cs:115:56:115:58 | "}" | FormatInvalid.cs:115:56:115:58 | [assertion success] "}" | FormatInvalid.cs:115:56:115:58 | [assertion success] "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:115:9:115:63 | call to method Assert | this | FormatInvalid.cs:115:9:115:63 | call to method Assert | this |
| FormatInvalid.cs:116:18:116:20 | "}" | FormatInvalid.cs:116:18:116:20 | "}" | FormatInvalid.cs:116:18:116:20 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:116:9:116:24 | call to method Write | this | FormatInvalid.cs:116:9:116:24 | call to method Write | this |
| FormatInvalid.cs:117:40:117:42 | "}" | FormatInvalid.cs:117:40:117:42 | "}" | FormatInvalid.cs:117:40:117:42 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:117:9:117:47 | call to method Print | this | FormatInvalid.cs:117:9:117:47 | call to method Print | this |
| FormatInvalid.cs:76:23:76:25 | "}" | FormatInvalid.cs:76:23:76:25 | "}" | FormatInvalid.cs:76:23:76:25 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:76:9:76:29 | call to method Format | this | FormatInvalid.cs:76:9:76:29 | call to method Format | this |
| FormatInvalid.cs:77:23:77:25 | "}" | FormatInvalid.cs:77:23:77:25 | "}" | FormatInvalid.cs:77:23:77:25 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:77:9:77:30 | call to method Format | this | FormatInvalid.cs:77:9:77:30 | call to method Format | this |
| FormatInvalid.cs:78:27:78:29 | "}" | FormatInvalid.cs:78:27:78:29 | "}" | FormatInvalid.cs:78:27:78:29 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:78:9:78:34 | call to method Format | this | FormatInvalid.cs:78:9:78:34 | call to method Format | this |
| FormatInvalid.cs:79:23:79:25 | "}" | FormatInvalid.cs:79:23:79:25 | "}" | FormatInvalid.cs:79:23:79:25 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:79:9:79:32 | call to method Format | this | FormatInvalid.cs:79:9:79:32 | call to method Format | this |
| FormatInvalid.cs:80:23:80:25 | "}" | FormatInvalid.cs:80:23:80:25 | "}" | FormatInvalid.cs:80:23:80:25 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:80:9:80:35 | call to method Format | this | FormatInvalid.cs:80:9:80:35 | call to method Format | this |
| FormatInvalid.cs:81:23:81:25 | "}" | FormatInvalid.cs:81:23:81:25 | "}" | FormatInvalid.cs:81:23:81:25 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:81:9:81:38 | call to method Format | this | FormatInvalid.cs:81:9:81:38 | call to method Format | this |
| FormatInvalid.cs:84:25:84:27 | "}" | FormatInvalid.cs:84:25:84:27 | "}" | FormatInvalid.cs:84:25:84:27 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:84:9:84:31 | call to method AppendFormat | this | FormatInvalid.cs:84:9:84:31 | call to method AppendFormat | this |
| FormatInvalid.cs:85:25:85:27 | "}" | FormatInvalid.cs:85:25:85:27 | "}" | FormatInvalid.cs:85:25:85:27 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:85:9:85:32 | call to method AppendFormat | this | FormatInvalid.cs:85:9:85:32 | call to method AppendFormat | this |
| FormatInvalid.cs:86:29:86:31 | "}" | FormatInvalid.cs:86:29:86:31 | "}" | FormatInvalid.cs:86:29:86:31 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:86:9:86:36 | call to method AppendFormat | this | FormatInvalid.cs:86:9:86:36 | call to method AppendFormat | this |
| FormatInvalid.cs:87:25:87:27 | "}" | FormatInvalid.cs:87:25:87:27 | "}" | FormatInvalid.cs:87:25:87:27 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:87:9:87:34 | call to method AppendFormat | this | FormatInvalid.cs:87:9:87:34 | call to method AppendFormat | this |
| FormatInvalid.cs:88:25:88:27 | "}" | FormatInvalid.cs:88:25:88:27 | "}" | FormatInvalid.cs:88:25:88:27 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:88:9:88:37 | call to method AppendFormat | this | FormatInvalid.cs:88:9:88:37 | call to method AppendFormat | this |
| FormatInvalid.cs:89:25:89:27 | "}" | FormatInvalid.cs:89:25:89:27 | "}" | FormatInvalid.cs:89:25:89:27 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:89:9:89:40 | call to method AppendFormat | this | FormatInvalid.cs:89:9:89:40 | call to method AppendFormat | this |
| FormatInvalid.cs:91:27:91:29 | "}" | FormatInvalid.cs:91:27:91:29 | "}" | FormatInvalid.cs:91:27:91:29 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:91:9:91:33 | call to method WriteLine | this | FormatInvalid.cs:91:9:91:33 | call to method WriteLine | this |
| FormatInvalid.cs:92:27:92:29 | "}" | FormatInvalid.cs:92:27:92:29 | "}" | FormatInvalid.cs:92:27:92:29 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:92:9:92:34 | call to method WriteLine | this | FormatInvalid.cs:92:9:92:34 | call to method WriteLine | this |
| FormatInvalid.cs:93:27:93:29 | "}" | FormatInvalid.cs:93:27:93:29 | "}" | FormatInvalid.cs:93:27:93:29 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:93:9:93:36 | call to method WriteLine | this | FormatInvalid.cs:93:9:93:36 | call to method WriteLine | this |
| FormatInvalid.cs:94:27:94:29 | "}" | FormatInvalid.cs:94:27:94:29 | "}" | FormatInvalid.cs:94:27:94:29 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:94:9:94:39 | call to method WriteLine | this | FormatInvalid.cs:94:9:94:39 | call to method WriteLine | this |
| FormatInvalid.cs:95:27:95:29 | "}" | FormatInvalid.cs:95:27:95:29 | "}" | FormatInvalid.cs:95:27:95:29 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:95:9:95:42 | call to method WriteLine | this | FormatInvalid.cs:95:9:95:42 | call to method WriteLine | this |
| FormatInvalid.cs:97:22:97:24 | "}" | FormatInvalid.cs:97:22:97:24 | "}" | FormatInvalid.cs:97:22:97:24 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:97:9:97:28 | call to method WriteLine | this | FormatInvalid.cs:97:9:97:28 | call to method WriteLine | this |
| FormatInvalid.cs:98:22:98:24 | "}" | FormatInvalid.cs:98:22:98:24 | "}" | FormatInvalid.cs:98:22:98:24 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:98:9:98:29 | call to method WriteLine | this | FormatInvalid.cs:98:9:98:29 | call to method WriteLine | this |
| FormatInvalid.cs:99:22:99:24 | "}" | FormatInvalid.cs:99:22:99:24 | "}" | FormatInvalid.cs:99:22:99:24 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:99:9:99:31 | call to method WriteLine | this | FormatInvalid.cs:99:9:99:31 | call to method WriteLine | this |
| FormatInvalid.cs:100:22:100:24 | "}" | FormatInvalid.cs:100:22:100:24 | "}" | FormatInvalid.cs:100:22:100:24 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:100:9:100:34 | call to method WriteLine | this | FormatInvalid.cs:100:9:100:34 | call to method WriteLine | this |
| FormatInvalid.cs:101:22:101:24 | "}" | FormatInvalid.cs:101:22:101:24 | "}" | FormatInvalid.cs:101:22:101:24 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:101:9:101:37 | call to method WriteLine | this | FormatInvalid.cs:101:9:101:37 | call to method WriteLine | this |
| FormatInvalid.cs:103:44:103:46 | "}" | FormatInvalid.cs:103:44:103:46 | "}" | FormatInvalid.cs:103:44:103:46 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:103:9:103:51 | call to method WriteLine | this | FormatInvalid.cs:103:9:103:51 | call to method WriteLine | this |
| FormatInvalid.cs:104:45:104:47 | "}" | FormatInvalid.cs:104:45:104:47 | "}" | FormatInvalid.cs:104:45:104:47 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:104:9:104:51 | call to method TraceError | this | FormatInvalid.cs:104:9:104:51 | call to method TraceError | this |
| FormatInvalid.cs:105:51:105:53 | "}" | FormatInvalid.cs:105:51:105:53 | "}" | FormatInvalid.cs:105:51:105:53 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:105:9:105:57 | call to method TraceInformation | this | FormatInvalid.cs:105:9:105:57 | call to method TraceInformation | this |
| FormatInvalid.cs:106:47:106:49 | "}" | FormatInvalid.cs:106:47:106:49 | "}" | FormatInvalid.cs:106:47:106:49 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:106:9:106:53 | call to method TraceWarning | this | FormatInvalid.cs:106:9:106:53 | call to method TraceWarning | this |
| FormatInvalid.cs:107:29:107:31 | "}" | FormatInvalid.cs:107:29:107:31 | "}" | FormatInvalid.cs:107:29:107:31 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:107:9:107:35 | call to method TraceInformation | this | FormatInvalid.cs:107:9:107:35 | call to method TraceInformation | this |
| FormatInvalid.cs:109:23:109:25 | "}" | FormatInvalid.cs:109:23:109:25 | "}" | FormatInvalid.cs:109:23:109:25 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:109:9:109:29 | call to method Write | this | FormatInvalid.cs:109:9:109:29 | call to method Write | this |
| FormatInvalid.cs:110:23:110:25 | "}" | FormatInvalid.cs:110:23:110:25 | "}" | FormatInvalid.cs:110:23:110:25 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:110:9:110:32 | call to method Write | this | FormatInvalid.cs:110:9:110:32 | call to method Write | this |
| FormatInvalid.cs:111:23:111:25 | "}" | FormatInvalid.cs:111:23:111:25 | "}" | FormatInvalid.cs:111:23:111:25 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:111:9:111:35 | call to method Write | this | FormatInvalid.cs:111:9:111:35 | call to method Write | this |
| FormatInvalid.cs:112:23:112:25 | "}" | FormatInvalid.cs:112:23:112:25 | "}" | FormatInvalid.cs:112:23:112:25 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:112:9:112:38 | call to method Write | this | FormatInvalid.cs:112:9:112:38 | call to method Write | this |
| FormatInvalid.cs:117:56:117:58 | "}" | FormatInvalid.cs:117:56:117:58 | [assertion success] "}" | FormatInvalid.cs:117:56:117:58 | [assertion success] "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:117:9:117:63 | call to method Assert | this | FormatInvalid.cs:117:9:117:63 | call to method Assert | this |
| FormatInvalid.cs:118:18:118:20 | "}" | FormatInvalid.cs:118:18:118:20 | "}" | FormatInvalid.cs:118:18:118:20 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:118:9:118:24 | call to method Write | this | FormatInvalid.cs:118:9:118:24 | call to method Write | this |
| FormatInvalid.cs:119:40:119:42 | "}" | FormatInvalid.cs:119:40:119:42 | "}" | FormatInvalid.cs:119:40:119:42 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:119:9:119:47 | call to method Print | this | FormatInvalid.cs:119:9:119:47 | call to method Print | this |
| FormatInvalid.cs:124:9:124:32 | call to method WriteLine | FormatInvalid.cs:124:27:124:31 | "{0}" | FormatInvalid.cs:124:27:124:31 | "{0}" | Argument '{0}' has not been supplied to $@ format string. | FormatInvalid.cs:124:27:124:31 | "{0}" | this | FormatInvalid.cs:124:27:124:31 | "{0}" | this |
| FormatInvalid.cs:125:9:125:28 | call to method Write | FormatInvalid.cs:125:23:125:27 | "{0}" | FormatInvalid.cs:125:23:125:27 | "{0}" | Argument '{0}' has not been supplied to $@ format string. | FormatInvalid.cs:125:23:125:27 | "{0}" | this | FormatInvalid.cs:125:23:125:27 | "{0}" | this |
| FormatInvalid.cs:126:9:126:27 | call to method WriteLine | FormatInvalid.cs:126:22:126:26 | "{0}" | FormatInvalid.cs:126:22:126:26 | "{0}" | Argument '{0}' has not been supplied to $@ format string. | FormatInvalid.cs:126:22:126:26 | "{0}" | this | FormatInvalid.cs:126:22:126:26 | "{0}" | this |
| FormatInvalid.cs:127:9:127:23 | call to method Write | FormatInvalid.cs:127:18:127:22 | "{0}" | FormatInvalid.cs:127:18:127:22 | "{0}" | Argument '{0}' has not been supplied to $@ format string. | FormatInvalid.cs:127:18:127:22 | "{0}" | this | FormatInvalid.cs:127:18:127:22 | "{0}" | this |
| FormatInvalid.cs:128:9:128:45 | call to method Print | FormatInvalid.cs:128:40:128:44 | "{0}" | FormatInvalid.cs:128:40:128:44 | "{0}" | Argument '{0}' has not been supplied to $@ format string. | FormatInvalid.cs:128:40:128:44 | "{0}" | this | FormatInvalid.cs:128:40:128:44 | "{0}" | this |
| FormatInvalid.cs:131:9:131:50 | call to method TraceError | FormatInvalid.cs:131:45:131:49 | "{0}" | FormatInvalid.cs:131:45:131:49 | "{0}" | Argument '{0}' has not been supplied to $@ format string. | FormatInvalid.cs:131:45:131:49 | "{0}" | this | FormatInvalid.cs:131:45:131:49 | "{0}" | this |
| FormatInvalid.cs:132:9:132:56 | call to method TraceInformation | FormatInvalid.cs:132:51:132:55 | "{0}" | FormatInvalid.cs:132:51:132:55 | "{0}" | Argument '{0}' has not been supplied to $@ format string. | FormatInvalid.cs:132:51:132:55 | "{0}" | this | FormatInvalid.cs:132:51:132:55 | "{0}" | this |
| FormatInvalid.cs:133:9:133:52 | call to method TraceWarning | FormatInvalid.cs:133:47:133:51 | "{0}" | FormatInvalid.cs:133:47:133:51 | "{0}" | Argument '{0}' has not been supplied to $@ format string. | FormatInvalid.cs:133:47:133:51 | "{0}" | this | FormatInvalid.cs:133:47:133:51 | "{0}" | this |
| FormatInvalid.cs:134:9:134:34 | call to method TraceInformation | FormatInvalid.cs:134:29:134:33 | "{0}" | FormatInvalid.cs:134:29:134:33 | "{0}" | Argument '{0}' has not been supplied to $@ format string. | FormatInvalid.cs:134:29:134:33 | "{0}" | this | FormatInvalid.cs:134:29:134:33 | "{0}" | this |
| FormatInvalidBad.cs:7:30:7:44 | "class {0} { }" | FormatInvalidBad.cs:7:30:7:44 | "class {0} { }" | FormatInvalidBad.cs:7:30:7:44 | "class {0} { }" | Invalid format string used in $@ formatting call. | FormatInvalidBad.cs:7:16:7:50 | call to method Format | this | FormatInvalidBad.cs:7:16:7:50 | call to method Format | this |
| FormatMissingArgument.cs:11:9:11:31 | call to method Format | FormatMissingArgument.cs:11:23:11:27 | "{1}" | FormatMissingArgument.cs:11:23:11:27 | "{1}" | Argument '{1}' has not been supplied to $@ format string. | FormatMissingArgument.cs:11:23:11:27 | "{1}" | this | FormatMissingArgument.cs:11:23:11:27 | "{1}" | this |
| FormatMissingArgument.cs:11:9:11:31 | call to method Format | FormatMissingArgument.cs:11:23:11:27 | "{1}" | FormatMissingArgument.cs:11:23:11:27 | "{1}" | The $@ ignores $@. | FormatMissingArgument.cs:11:23:11:27 | "{1}" | format string | FormatMissingArgument.cs:11:30:11:30 | (...) ... | this supplied value |
@@ -91,39 +100,50 @@ nodes
| FormatInvalid.cs:58:23:58:33 | "{0}{{{{}}" | semmle.label | "{0}{{{{}}" |
| FormatInvalid.cs:75:23:75:25 | "}" | semmle.label | "}" |
| FormatInvalid.cs:76:23:76:25 | "}" | semmle.label | "}" |
| FormatInvalid.cs:77:27:77:29 | "}" | semmle.label | "}" |
| FormatInvalid.cs:78:23:78:25 | "}" | semmle.label | "}" |
| FormatInvalid.cs:77:23:77:25 | "}" | semmle.label | "}" |
| FormatInvalid.cs:78:27:78:29 | "}" | semmle.label | "}" |
| FormatInvalid.cs:79:23:79:25 | "}" | semmle.label | "}" |
| FormatInvalid.cs:80:23:80:25 | "}" | semmle.label | "}" |
| FormatInvalid.cs:82:25:82:27 | "}" | semmle.label | "}" |
| FormatInvalid.cs:81:23:81:25 | "}" | semmle.label | "}" |
| FormatInvalid.cs:83:25:83:27 | "}" | semmle.label | "}" |
| FormatInvalid.cs:84:29:84:31 | "}" | semmle.label | "}" |
| FormatInvalid.cs:84:25:84:27 | "}" | semmle.label | "}" |
| FormatInvalid.cs:85:25:85:27 | "}" | semmle.label | "}" |
| FormatInvalid.cs:86:25:86:27 | "}" | semmle.label | "}" |
| FormatInvalid.cs:86:29:86:31 | "}" | semmle.label | "}" |
| FormatInvalid.cs:87:25:87:27 | "}" | semmle.label | "}" |
| FormatInvalid.cs:89:27:89:29 | "}" | semmle.label | "}" |
| FormatInvalid.cs:90:27:90:29 | "}" | semmle.label | "}" |
| FormatInvalid.cs:88:25:88:27 | "}" | semmle.label | "}" |
| FormatInvalid.cs:89:25:89:27 | "}" | semmle.label | "}" |
| FormatInvalid.cs:91:27:91:29 | "}" | semmle.label | "}" |
| FormatInvalid.cs:92:27:92:29 | "}" | semmle.label | "}" |
| FormatInvalid.cs:93:27:93:29 | "}" | semmle.label | "}" |
| FormatInvalid.cs:95:22:95:24 | "}" | semmle.label | "}" |
| FormatInvalid.cs:96:22:96:24 | "}" | semmle.label | "}" |
| FormatInvalid.cs:94:27:94:29 | "}" | semmle.label | "}" |
| FormatInvalid.cs:95:27:95:29 | "}" | semmle.label | "}" |
| FormatInvalid.cs:97:22:97:24 | "}" | semmle.label | "}" |
| FormatInvalid.cs:98:22:98:24 | "}" | semmle.label | "}" |
| FormatInvalid.cs:99:22:99:24 | "}" | semmle.label | "}" |
| FormatInvalid.cs:101:44:101:46 | "}" | semmle.label | "}" |
| FormatInvalid.cs:102:45:102:47 | "}" | semmle.label | "}" |
| FormatInvalid.cs:103:51:103:53 | "}" | semmle.label | "}" |
| FormatInvalid.cs:104:47:104:49 | "}" | semmle.label | "}" |
| FormatInvalid.cs:105:29:105:31 | "}" | semmle.label | "}" |
| FormatInvalid.cs:107:23:107:25 | "}" | semmle.label | "}" |
| FormatInvalid.cs:108:23:108:25 | "}" | semmle.label | "}" |
| FormatInvalid.cs:100:22:100:24 | "}" | semmle.label | "}" |
| FormatInvalid.cs:101:22:101:24 | "}" | semmle.label | "}" |
| FormatInvalid.cs:103:44:103:46 | "}" | semmle.label | "}" |
| FormatInvalid.cs:104:45:104:47 | "}" | semmle.label | "}" |
| FormatInvalid.cs:105:51:105:53 | "}" | semmle.label | "}" |
| FormatInvalid.cs:106:47:106:49 | "}" | semmle.label | "}" |
| FormatInvalid.cs:107:29:107:31 | "}" | semmle.label | "}" |
| FormatInvalid.cs:109:23:109:25 | "}" | semmle.label | "}" |
| FormatInvalid.cs:110:23:110:25 | "}" | semmle.label | "}" |
| FormatInvalid.cs:115:56:115:58 | [assertion success] "}" | semmle.label | [assertion success] "}" |
| FormatInvalid.cs:116:18:116:20 | "}" | semmle.label | "}" |
| FormatInvalid.cs:117:40:117:42 | "}" | semmle.label | "}" |
| FormatInvalid.cs:119:27:119:29 | "}" | semmle.label | "}" |
| FormatInvalid.cs:111:23:111:25 | "}" | semmle.label | "}" |
| FormatInvalid.cs:112:23:112:25 | "}" | semmle.label | "}" |
| FormatInvalid.cs:117:56:117:58 | [assertion success] "}" | semmle.label | [assertion success] "}" |
| FormatInvalid.cs:118:18:118:20 | "}" | semmle.label | "}" |
| FormatInvalid.cs:119:40:119:42 | "}" | semmle.label | "}" |
| FormatInvalid.cs:121:27:121:29 | "}" | semmle.label | "}" |
| FormatInvalid.cs:124:27:124:31 | "{0}" | semmle.label | "{0}" |
| FormatInvalid.cs:125:23:125:27 | "{0}" | semmle.label | "{0}" |
| FormatInvalid.cs:126:22:126:26 | "{0}" | semmle.label | "{0}" |
| FormatInvalid.cs:127:18:127:22 | "{0}" | semmle.label | "{0}" |
| FormatInvalid.cs:128:40:128:44 | "{0}" | semmle.label | "{0}" |
| FormatInvalid.cs:131:45:131:49 | "{0}" | semmle.label | "{0}" |
| FormatInvalid.cs:132:51:132:55 | "{0}" | semmle.label | "{0}" |
| FormatInvalid.cs:133:47:133:51 | "{0}" | semmle.label | "{0}" |
| FormatInvalid.cs:134:29:134:33 | "{0}" | semmle.label | "{0}" |
| FormatInvalidBad.cs:7:30:7:44 | "class {0} { }" | semmle.label | "class {0} { }" |
| FormatInvalidGood.cs:7:30:7:46 | "class {0} {{ }}" | semmle.label | "class {0} {{ }}" |
| FormatMissingArgument.cs:8:23:8:27 | "{0}" | semmle.label | "{0}" |
@@ -154,3 +174,33 @@ nodes
| FormatUnusedArgumentBad.cs:8:27:8:60 | "Error processing file: {1} ({1})" | semmle.label | "Error processing file: {1} ({1})" |
| FormatUnusedArgumentBad.cs:9:27:9:58 | "Error processing file: %s (%d)" | semmle.label | "Error processing file: %s (%d)" |
subpaths
testFailures
| FormatInvalid.cs:75:29:75:38 | // ... | Missing result: Alert |
| FormatInvalid.cs:83:31:83:40 | // ... | Missing result: Alert |
| FormatInvalid.cs:124:9:124:32 | FormatInvalid.cs:124:27:124:31 | Unexpected result: Alert |
| FormatInvalid.cs:124:27:124:31 | "{0}" | Unexpected result: Alert |
| FormatInvalid.cs:124:27:124:31 | "{0}" | Unexpected result: Sink |
| FormatInvalid.cs:125:9:125:28 | FormatInvalid.cs:125:23:125:27 | Unexpected result: Alert |
| FormatInvalid.cs:125:23:125:27 | "{0}" | Unexpected result: Alert |
| FormatInvalid.cs:125:23:125:27 | "{0}" | Unexpected result: Sink |
| FormatInvalid.cs:126:9:126:27 | FormatInvalid.cs:126:22:126:26 | Unexpected result: Alert |
| FormatInvalid.cs:126:22:126:26 | "{0}" | Unexpected result: Alert |
| FormatInvalid.cs:126:22:126:26 | "{0}" | Unexpected result: Sink |
| FormatInvalid.cs:127:9:127:23 | FormatInvalid.cs:127:18:127:22 | Unexpected result: Alert |
| FormatInvalid.cs:127:18:127:22 | "{0}" | Unexpected result: Alert |
| FormatInvalid.cs:127:18:127:22 | "{0}" | Unexpected result: Sink |
| FormatInvalid.cs:128:9:128:45 | FormatInvalid.cs:128:40:128:44 | Unexpected result: Alert |
| FormatInvalid.cs:128:40:128:44 | "{0}" | Unexpected result: Alert |
| FormatInvalid.cs:128:40:128:44 | "{0}" | Unexpected result: Sink |
| FormatInvalid.cs:131:9:131:50 | FormatInvalid.cs:131:45:131:49 | Unexpected result: Alert |
| FormatInvalid.cs:131:45:131:49 | "{0}" | Unexpected result: Alert |
| FormatInvalid.cs:131:45:131:49 | "{0}" | Unexpected result: Sink |
| FormatInvalid.cs:132:9:132:56 | FormatInvalid.cs:132:51:132:55 | Unexpected result: Alert |
| FormatInvalid.cs:132:51:132:55 | "{0}" | Unexpected result: Alert |
| FormatInvalid.cs:132:51:132:55 | "{0}" | Unexpected result: Sink |
| FormatInvalid.cs:133:9:133:52 | FormatInvalid.cs:133:47:133:51 | Unexpected result: Alert |
| FormatInvalid.cs:133:47:133:51 | "{0}" | Unexpected result: Alert |
| FormatInvalid.cs:133:47:133:51 | "{0}" | Unexpected result: Sink |
| FormatInvalid.cs:134:9:134:34 | FormatInvalid.cs:134:29:134:33 | Unexpected result: Alert |
| FormatInvalid.cs:134:29:134:33 | "{0}" | Unexpected result: Alert |
| FormatInvalid.cs:134:29:134:33 | "{0}" | Unexpected result: Sink |