Skip to main content

Analyzers

Groups

PrefixComment
RCS1common analyzers
RCS0formatting analyzers
RCS9suitable for projects that reference Roslyn packages (Microsoft.CodeAnalysis*)

List of Analyzers

IdTitleDefault Severity
RCS0001Add blank line after embedded statement-
RCS0002Add blank line after #region-
RCS0003Add blank line after using directive list-
RCS0005Add blank line before #endregion-
RCS0006Add blank line before using directive list-
RCS0007Add blank line between accessors-
RCS0008Add blank line between closing brace and next statement-
RCS0009Add blank line between declaration and documentation comment-
RCS0010Add blank line between declarations-
RCS0011Add/remove blank line between single-line accessors-
RCS0012Add blank line between single-line declarations-
RCS0013Add blank line between single-line declarations of different kind-
RCS0015Add/remove blank line between using directives-
RCS0016Put attribute list on its own line-
RCS0020Format accessor's braces on a single line or multiple lines-
RCS0021Format block's braces on a single line or multiple lines-
RCS0023Format type declaration's braces-
RCS0024Add new line after switch label-
RCS0025Put full accessor on its own line-
RCS0027Place new line after/before binary operator-
RCS0028Place new line after/before '?:' operator-
RCS0029Put constructor initializer on its own line-
RCS0030Put embedded statement on its own line-
RCS0031Put enum member on its own line-
RCS0032Place new line after/before arrow token-
RCS0033Put statement on its own line-
RCS0034Put type parameter constraint on its own line-
RCS0036Remove blank line between single-line declarations of same kind-
RCS0039Remove new line before base list-
RCS0041Remove new line between 'if' keyword and 'else' keyword-
RCS0042Put auto-accessors on a single line-
RCS0044Use carriage return + linefeed as new line-
RCS0045Use linefeed as new line-
RCS0046Use spaces instead of tab-
RCS0048Put initializer on a single line-
RCS0049Add blank line after top comment-
RCS0050Add blank line before top declaration-
RCS0051Add/remove new line before 'while' in 'do' statement-
RCS0052Place new line after/before equals token-
RCS0053Fix formatting of a list-
RCS0054Fix formatting of a call chain-
RCS0055Fix formatting of a binary expression chain-
RCS0056A line is too long-
RCS0057Normalize whitespace at the beginning of a file-
RCS0058Normalize whitespace at the end of a file-
RCS0059Place new line after/before null-conditional operator-
RCS0060Add/remove line after file scoped namespace declaration-
RCS0061Add/remove blank line between switch sections-
RCS1001Add braces (when expression spans over multiple lines)Info
RCS1002Remove braces-
RCS1003Add braces to if-else (when expression spans over multiple lines)Info
RCS1004Remove braces from if-else-
RCS1005Simplify nested using statementHidden
RCS1006Merge 'else' with nested 'if'Hidden
RCS1007Add braces-
RCS1013Use predefined type-
RCS1014Use explicitly/implicitly typed array-
RCS1015Use nameof operatorInfo
RCS1016Use block body or expression body-
RCS1018Add/remove accessibility modifiers-
RCS1019Order modifiers-
RCS1020Simplify Nullable\<T> to T?Info
RCS1021Convert lambda expression body to expression bodyInfo
RCS1031Remove unnecessary braces in switch sectionHidden
RCS1032Remove redundant parenthesesInfo
RCS1033Remove redundant boolean literalInfo
RCS1034Remove redundant 'sealed' modifierHidden
RCS1036Remove unnecessary blank lineInfo
RCS1037Remove trailing white-spaceInfo
RCS1039Remove argument list from attributeHidden
RCS1042Remove enum default underlying typeHidden
RCS1043Remove 'partial' modifier from type with a single partHidden
RCS1044Remove original exception from throw statementWarning
RCS1046Asynchronous method name should end with 'Async'-
RCS1047Non-asynchronous method name should not end with 'Async'Info
RCS1048Use lambda expression instead of anonymous methodInfo
RCS1049Simplify boolean comparisonInfo
RCS1050Include/omit parentheses when creating new object-
RCS1051Add/remove parentheses from condition in conditional operator-
RCS1052Declare each attribute separately-
RCS1055Unnecessary semicolon at the end of declarationHidden
RCS1056Avoid usage of using alias directive-
RCS1058Use compound assignmentInfo
RCS1059Avoid locking on publicly accessible instanceWarning
RCS1060Declare each type in separate file-
RCS1061Merge 'if' with nested 'if'Hidden
RCS1068Simplify logical negationInfo
RCS1069Remove unnecessary case labelHidden
RCS1070Remove redundant default switch sectionHidden
RCS1071Remove redundant base constructor callHidden
RCS1073Convert 'if' to 'return' statementInfo
RCS1074Remove redundant constructorHidden
RCS1075Avoid empty catch clause that catches System.ExceptionWarning
RCS1077Optimize LINQ method callInfo
RCS1078Use "" or 'string.Empty'-
RCS1079Throwing of new NotImplementedException-
RCS1080Use 'Count/Length' property instead of 'Any' method-
RCS1081Split variable declaration-
RCS1084Use coalesce expression instead of conditional expressionInfo
RCS1085Use auto-implemented propertyInfo
RCS1089Use --/++ operator instead of assignmentInfo
RCS1090Add/remove 'ConfigureAwait(false)' call-
RCS1093File contains no codeInfo
RCS1094Declare using directive on top level-
RCS1096Use 'HasFlag' method or bitwise operator-
RCS1097Remove redundant 'ToString' callInfo
RCS1098Constant values should be placed on right side of comparisonsInfo
RCS1099Default label should be the last label in a switch sectionInfo
RCS1102Make class staticWarning
RCS1103Convert 'if' to assignmentInfo
RCS1104Simplify conditional expressionInfo
RCS1105Unnecessary interpolationInfo
RCS1107Remove redundant 'ToCharArray' callInfo
RCS1108Add 'static' modifier to all partial class declarationsInfo
RCS1110Declare type inside namespaceInfo
RCS1111Add braces to switch section with multiple statements-
RCS1112Combine 'Enumerable.Where' method chainInfo
RCS1113Use 'string.IsNullOrEmpty' methodInfo
RCS1114Remove redundant delegate creationInfo
RCS1118Mark local variable as constInfo
RCS1123Add parentheses when necessaryInfo
RCS1124Inline local variableHidden
RCS1126Add braces to if-else-
RCS1128Use coalesce expressionInfo
RCS1129Remove redundant field initializationHidden
RCS1130Bitwise operation on enum without Flags attributeInfo
RCS1132Remove redundant overriding memberInfo
RCS1133Remove redundant Dispose/Close callHidden
RCS1134Remove redundant statementHidden
RCS1135Declare enum member with zero value (when enum has FlagsAttribute)Info
RCS1136Merge switch sections with equivalent contentHidden
RCS1138Add summary to documentation commentWarning
RCS1139Add summary element to documentation commentWarning
RCS1140Add exception to documentation commentHidden
RCS1141Add 'param' element to documentation commentHidden
RCS1142Add 'typeparam' element to documentation commentHidden
RCS1143Simplify coalesce expressionHidden
RCS1145Remove redundant 'as' operatorHidden
RCS1146Use conditional accessInfo
RCS1151Remove redundant castHidden
RCS1154Sort enum membersInfo
RCS1155Use StringComparison when comparing stringsWarning
RCS1156Use string.Length instead of comparison with empty stringInfo
RCS1157Composite enum value contains undefined flagInfo
RCS1158Static member in generic type should use a type parameterInfo
RCS1159Use EventHandler\<T>Info
RCS1160Abstract type should not have public constructorsInfo
RCS1161Enum should declare explicit valuesHidden
RCS1162Avoid chain of assignments-
RCS1163Unused parameterInfo
RCS1164Unused type parameterInfo
RCS1165Unconstrained type parameter checked for nullHidden
RCS1166Value type object is never equal to nullInfo
RCS1168Parameter name differs from base nameHidden
RCS1169Make field read-onlyInfo
RCS1170Use read-only auto-implemented propertyInfo
RCS1171Simplify lazy initializationInfo
RCS1172Use 'is' operator instead of 'as' operatorWarning
RCS1173Use coalesce expression instead of 'if'Info
RCS1174Remove redundant async/await-
RCS1175Unused 'this' parameterInfo
RCS1179Unnecessary assignmentInfo
RCS1180Inline lazy initializationInfo
RCS1181Convert comment to documentation commentHidden
RCS1182Remove redundant base interfaceHidden
RCS1186Use Regex instance instead of static methodHidden
RCS1187Use constant instead of fieldInfo
RCS1188Remove redundant auto-property initializationHidden
RCS1189Add or remove region nameHidden
RCS1190Join string expressionsInfo
RCS1191Declare enum value as combination of namesInfo
RCS1192Unnecessary usage of verbatim string literalInfo
RCS1193Overriding member should not change 'params' modifierWarning
RCS1194Implement exception constructorsWarning
RCS1195Use ^ operatorInfo
RCS1196Call extension method as instance methodInfo
RCS1197Optimize StringBuilder.Append/AppendLine callInfo
RCS1198Avoid unnecessary boxing of value type-
RCS1199Unnecessary null checkInfo
RCS1200Call 'Enumerable.ThenBy' instead of 'Enumerable.OrderBy'Info
RCS1201Use method chainingHidden
RCS1202Avoid NullReferenceExceptionInfo
RCS1203Use AttributeUsageAttributeWarning
RCS1204Use EventArgs.EmptyInfo
RCS1205Order named arguments according to the order of parametersInfo
RCS1206Use conditional access instead of conditional expressionInfo
RCS1207Use anonymous function or method group-
RCS1208Reduce 'if' nesting-
RCS1209Order type parameter constraintsInfo
RCS1210Return completed task instead of returning nullWarning
RCS1211Remove unnecessary 'else'Hidden
RCS1212Remove redundant assignmentInfo
RCS1213Remove unused member declarationInfo
RCS1214Unnecessary interpolated stringInfo
RCS1215Expression is always equal to true/falseWarning
RCS1216Unnecessary unsafe contextInfo
RCS1217Convert interpolated string to concatenationHidden
RCS1218Simplify code branchingInfo
RCS1220Use pattern matching instead of combination of 'is' operator and cast operatorInfo
RCS1221Use pattern matching instead of combination of 'as' operator and null checkInfo
RCS1222Merge preprocessor directivesInfo
RCS1223Mark publicly visible type with DebuggerDisplay attribute-
RCS1224Make method an extension methodInfo
RCS1225Make class sealedInfo
RCS1226Add paragraph to documentation commentInfo
RCS1227Validate arguments correctlyInfo
RCS1228Unused element in a documentation commentHidden
RCS1229Use async/await when necessaryInfo
RCS1230Unnecessary explicit use of enumeratorInfo
RCS1231Make parameter ref read-only-
RCS1232Order elements in documentation commentInfo
RCS1233Use short-circuiting operatorInfo
RCS1234Duplicate enum valueInfo
RCS1235Optimize method callInfo
RCS1236Use exception filterInfo
RCS1238Avoid nested ?: operatorsHidden
RCS1239Use 'for' statement instead of 'while' statementInfo
RCS1240Operator is unnecessaryInfo
RCS1241Implement non-generic counterpartHidden
RCS1242Do not pass non-read-only struct by read-only referenceWarning
RCS1243Duplicate word in a commentInfo
RCS1244Simplify 'default' expressionHidden
RCS1246Use element accessInfo
RCS1247Fix documentation comment tagInfo
RCS1248Normalize null check-
RCS1249Unnecessary null-forgiving operatorInfo
RCS1250Use implicit/explicit object creation-
RCS1251Remove unnecessary braces from record declarationInfo
RCS1252Normalize usage of infinite loop-
RCS1253Format documentation comment summary-
RCS1254Normalize format of enum flag valueInfo
RCS1255Simplify argument null check-
RCS1256Invalid argument null checkInfo
RCS1257Use enum field explicitlyInfo
RCS1258Unnecessary enum flagInfo
RCS1259Remove empty syntaxInfo
RCS1260Add/remove trailing comma-
RCS1261Resource can be disposed asynchronouslyInfo
RCS1262Unnecessary raw string literalInfo
RCS1263Invalid reference in a documentation commentWarning
RCS1264Use 'var' or explicit type-
RCS1265Remove redundant catch blockInfo
RCS1266Use raw string literalInfo
RCS1267Use string interpolation instead of 'string.Concat'Info
RCS1268Simplify numeric comparisonInfo
RCS9001Use pattern matchingHidden
RCS9002Use property SyntaxNode.SpanStartInfo
RCS9003Unnecessary conditional accessInfo
RCS9004Call 'Any' instead of accessing 'Count'Info
RCS9005Unnecessary null checkInfo
RCS9006Use element accessInfo
RCS9007Use return valueWarning
RCS9008Call 'Last' instead of using []Info
RCS9009Unknown language nameWarning
RCS9010Specify ExportCodeRefactoringProviderAttribute.NameHidden
RCS9011Specify ExportCodeFixProviderAttribute.NameHidden