TreatWarningsAsErrors
TreatWarningsAsErrors
Build Warnings Summary
| # | Code | Description | |
|---|---|---|---|
| 2308 | CS1591 | Missing XML comment | |
| 2076 | CA1707 | Remove underscores from names | |
| 1658 | CS8618 | Non-nullable uninitialized | |
| 882 | CA2007 | Call ConfigureAwait | |
| 522 | CS8602 | Possibly null dereference | |
| 493 | CS8604 | Possible null argument | |
| 391 | IDE0009 | Add this qualification | |
| 378 | CS8625 | Null to non-nullable | |
| 374 | CA1307 | Specify StringComparison | |
| 342 | CS8600 | Null to non-nullable type | |
| 285 | IDE1006 | Naming rule violation | |
| 285 | CA1062 | Validate public args | |
| 268 | CA2000 | Dispose objects | |
| 222 | NU1701 | Package compatibility | |
| 221 | IDE0028 | Use collection initializer | |
| 182 | CA1305 | Specify IFormatProvider | |
| 182 | IDE0055 | Fix formatting | |
| 172 | NU1603 | Dependency version mismatch | |
| 157 | CA2227 | Read-only collection props | |
| 154 | IDE0058 | Unused expression value | |
| 150 | CA1031 | Catch specific exceptions | |
| 143 | CA1002 | Do not expose generic lists | |
| 143 | CA2201 | Reserved exception types | |
| 118 | CS1573 | Missing param XML tag | |
| 80 | IDE0300 | Use collection expression | |
| 79 | IDE0130 | Namespace mismatch | |
| 77 | CS1570 | Invalid XML in comment | |
| 75 | CS8603 | Possible null return | |
| 71 | IDE0073 | File header mismatch | |
| 68 | CA1829 | Use Length/Count property | |
| 59 | CA1822 | Mark members as static | |
| 58 | IDE0065 | Using directive placement | |
| 56 | CA1861 | Avoid constant arrays as args | |
| 55 | IDE0161 | Use file-scoped namespace | |
| 55 | CS8601 | Possible null assignment | |
| 52 | CA1823 | Avoid unused private fields | |
| 52 | IDE0044 | Make field readonly | |
| 50 | CA1826 | Use property not Enumerable | |
| 48 | CA1860 | Avoid Enumerable.Any() | |
| 47 | IDE0011 | Add braces | |
| 47 | CS0108 | Hides inherited member | |
| 46 | CS0618 | Obsolete member usage | |
| 43 | CA1304 | Specify CultureInfo | |
| 42 | CA1311 | Specify culture for strings | |
| 39 | IDE0059 | Unnecessary assignment | |
| 39 | CA1849 | Call async in async method | |
| 39 | MSB3277 | Assembly version conflict | |
| 38 | CA1508 | Dead conditional code | |
| 38 | IDE0060 | Remove unused parameter | |
| 36 | CA1851 | Possible multiple enumerations | |
| 36 | CS8620 | Nullability mismatch in arg | |
| 33 | CA1725 | Param names match base | |
| 33 | IDE0090 | Simplify new expression | |
| 32 | CA1308 | Normalize to uppercase | |
| 32 | CA1720 | No type names in identifiers | |
| 31 | CA1852 | Seal internal types | |
| 30 | CA1310 | Specify StringComparison | |
| 29 | CS0219 | Variable assigned not used | |
| 28 | IDE0010 | Add missing switch cases | |
| 26 | CA1859 | Use concrete types | |
| 26 | IDE0034 | Simplify default expression | |
| 26 | SYSLIB1045 | Use GeneratedRegex | |
| 24 | CA1825 | Avoid zero-length arrays | |
| 24 | CA2234 | Pass URIs not strings | |
| 23 | CA1724 | Type name conflicts namespace | |
| 23 | CS1998 | Async lacks await | |
| 21 | CA2016 | Forward CancellationToken | |
| 19 | CS1572 | Param tag no matching param | |
| 18 | IDE0057 | Use range operator | |
| 18 | CA1507 | Use nameof | |
| 18 | IDE0071 | Simplify interpolation | |
| 17 | CA1819 | Properties return arrays | |
| 16 | CA1051 | Visible instance fields | |
| 16 | IDE0017 | Use object initializers | |
| 16 | CS0168 | Variable never used | |
| 16 | CA1034 | Nested types visible | |
| 16 | CA1001 | Types own disposable fields | |
| 15 | CA1862 | Use StringComparison | |
| 15 | CA1032 | Implement exception ctors | |
| 15 | IDE0301 | Use collection expression | |
| 15 | CA1063 | Implement IDisposable | |
| 14 | IDE0072 | Add missing switch cases | |
| 14 | CS8629 | Nullable value may be null | |
| 13 | CS8632 | Nullable annotation context | |
| 12 | CS0169 | Field never used | |
| 12 | CA2254 | Template should be static | |
| 12 | CA1303 | Do not pass literals | |
| 12 | IDE0040 | Add accessibility modifiers | |
| 12 | CA1848 | Use LoggerMessage delegates | |
| 11 | CA1816 | Call GC.SuppressFinalize | |
| 11 | CA1068 | CancellationToken last | |
| 11 | CA1805 | Unnecessary initialization | |
| 11 | CA1715 | Identifier prefix | |
| 10 | IDE0305 | Use collection expression | |
| 10 | IDE0120 | Simplify LINQ | |
| 10 | CS8605 | Unboxing possibly null | |
| 10 | CA1869 | Cache JsonSerializerOptions | |
| 9 | CA1024 | Use properties | |
| 9 | CS9113 | Parameter unread | |
| 9 | CA1055 | URI return not string | |
| 9 | CS9124 | Param in state machine | |
| 9 | CA2208 | Correct ArgumentException | |
| 8 | CA1863 | Use char overload | |
| 8 | CA1854 | Prefer TryGetValue | |
| 8 | CA1052 | Seal static holder types | |
| 8 | CS4014 | Unawaited async call | |
| 8 | CS3021 | ||
| 7 | ASP0019 | Use IHeaderDictionary | |
| 7 | CA1827 | Use Any not Count | |
| 7 | IDE0020 | Pattern matching null check | |
| 7 | IDE0019 | Use pattern matching | |
| 7 | CA5399 | Disable cert check | |
| 7 | CA1716 | Identifier matches keyword | |
| 6 | CS9107 | Param captured and assigned | |
| 6 | SYSLIB0026 | Obsolete MutuallyAuth | |
| 6 | CS8767 | Nullability in param | |
| 6 | CA1866 | Use char overload | |
| 5 | CS8765 | Nullability in override | |
| 5 | CS1587 | Misplaced XML comment | |
| 5 | CA1834 | Use StringBuilder char | |
| 5 | CA1309 | Use ordinal StringComparison | |
| 5 | CA1721 | Property matches get method | |
| 4 | CA1054 | URI param not string | |
| 4 | IDE0100 | Unnecessary equality op | |
| 4 | CA1806 | Do not ignore results | |
| 4 | IDE0004 | Remove unnecessary cast | |
| 3 | CA1847 | Use string.Contains(char) | |
| 3 | CA1836 | Prefer IsEmpty over Count | |
| 3 | IDE0031 | Use null propagation | |
| 3 | IDE0027 | Use expression body | |
| 3 | CA1028 | Enum storage Int32 | |
| 3 | CA2211 | Non-constant visible fields | |
| 3 | CS8619 | Nullability mismatch | |
| 3 | IDE0220 | Add explicit cast | |
| 3 | CS8714 | Type param constraint | |
| 3 | CS0649 | Field never assigned | |
| 3 | CS8621 | Nullability in return type | |
| 2 | CS0114 | Hides inherited member | |
| 2 | IDE0200 | ||
| 2 | CA1069 | Duplicate enum values | |
| 2 | CA1008 | Enums have zero value | |
| 2 | CA1012 | Abstract types no ctors | |
| 2 | CA1850 | Prefer static HashData | |
| 2 | CA1027 | Mark enums with Flags | |
| 2 | CA5394 | Insecure randomness | |
| 2 | CA1820 | Test empty using length | |
| 2 | CA1812 | ||
| 2 | CA1056 | URI prop not string | |
| 2 | CA2213 | Dispose disposable fields | |
| 2 | CA1711 | Incorrect identifier suffix | |
| 2 | CA1845 | Use span-based Concat | |
| 1 | IDE0210 | ||
| 1 | CA2215 | Call base Dispose | |
| 1 | CS8622 | Nullability in parameter | |
| 1 | ASP0018 | Unused route parameter | |
| 1 | CA1016 | Mark with AssemblyVersion | |
| 1 | CA1033 | Interface callable by child | |
| 1 | CA1040 | Avoid empty interfaces | |
| 1 | CA1065 | Unexpected exception location | |
| 1 | CA1067 | Override Equals for IEquatable | |
| 1 | CA1416 | Platform compatibility | |
| 1 | CA1510 | Use ThrowIfNull | |
| 1 | CA1844 | Memory-based overrides | |
| 1 | CA1846 | Prefer AsSpan | |
| 1 | CA1867 | Use char overload | |
| 1 | CS0162 | Unreachable code | |
| 1 | CS0659 | Missing GetHashCode | |
| 1 | CS1571 | Duplicate param XML tag | |
| 1 | CS1574 | Unresolved cref | |
| 1 | CS8524 | Missing enum switch cases | |
| 1 | CS8613 | Nullability in return | |
| 1 | IDE0056 | Use index operator | |
| 1 | ASP0000 | Avoid BuildServiceProvider | |
| 14662 | Total | ||
To put this in perspective, here is a summary of the codebase in question. This is not a large codebase by any stretch: roughly 145,000 lines of C# spread across about a thousand files. And yet, 14,662 warnings. That is roughly one warning for every ten lines of code.
===============================================================================
Language Files Lines Code Comments Blanks
===============================================================================
Batch 2 51 36 2 13
C# 1028 193547 144963 24483 24101
Dockerfile 2 43 22 8 13
JSON 525 235599 235461 0 138
MSBuild 40 1414 1251 36 127
PowerShell 3 449 317 72 60
Python 4 1561 1214 107 240
Shell 6 1308 955 121 232
SQL 6 318 291 2 25
Plain Text 55 6030 0 5855 175
Visual Studio Sol 6 415 409 0 6
YAML 148 20180 18969 715 496
-------------------------------------------------------------------------------
Markdown 12 1822 0 1382 440
|- BASH 2 60 34 16 10
|- JSON 1 31 31 0 0
|- PowerShell 1 5 4 1 0
|- Python 1 25 14 7 4
|- SQL 1 5 5 0 0
(Total) 1948 88 1406 454
===============================================================================
Total 1837 462737 403888 32783 26066
===============================================================================