Skip to content

NickCraver/Roslynator

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Roslynator

Settings

  • Analyzers can be enabled/disabled using rule set. Please see How to Customize Analyzers.
  • Refactorings can be enabled/disabled in Visual Studio options

Refactorings Options

Products

Extensions for Visual Studio 2017

Extensions for Visual Studio 2015

NuGet Packages

  • Roslynator.Analyzers (analyzers only).
    • This package is dependent on Microsoft.CodeAnalysis.CSharp.Workspaces.2.0.0 (Visual Studio 2017 or higher).
  • C# Analyzers (analyzers only).
    • This package is dependent on Microsoft.CodeAnalysis.CSharp.Workspaces.1.0.0 (Visual Studio 2015 or higher).

List of Analyzers

  • RCS1001 - Add braces
  • RCS1002 - Remove braces
  • RCS1003 - Add braces to if-else
  • RCS1004 - Remove braces from if-else
  • RCS1005 - Simplify nested using statement
  • RCS1006 - Merge else clause with nested if statement
  • RCS1007 - Avoid embedded statement
  • RCS1008 - Use explicit type instead of 'var' (when the type is not obvious)
  • RCS1009 - Use explicit type instead of 'var' (foreach variable)
  • RCS1010 - Use 'var' instead of explicit type (when the type is obvious)
  • RCS1012 - Use explicit type instead of 'var' (even if the type is obvious)
  • RCS1013 - Use predefined type
  • RCS1014 - Avoid implicitly-typed array
  • RCS1015 - Use nameof operator
  • RCS1016 - Use expression-bodied member
  • RCS1017 - Avoid multiline expression body
  • RCS1018 - Add default access modifier
  • RCS1019 - Reorder modifiers
  • RCS1020 - Simplify Nullable<T> to T?
  • RCS1021 - Simplify lambda expression
  • RCS1022 - Simplify lambda expression parameter list
  • RCS1023 - Format empty block
  • RCS1024 - Format accessor list
  • RCS1025 - Format each enum member on a separate line
  • RCS1026 - Format each statement on a separate line
  • RCS1027 - Format embedded statement on a separate line
  • RCS1028 - Format switch section's statement on a separate line
  • RCS1029 - Format binary operator on next line
  • RCS1030 - Add empty line after embedded statement
  • RCS1031 - Remove redundant braces
  • RCS1032 - Remove redundant parentheses
  • RCS1033 - Remove redundant boolean literal
  • RCS1034 - Remove redundant sealed modifier
  • RCS1035 - Remove redundant comma in initializer
  • RCS1036 - Remove redundant empty line
  • RCS1037 - Remove trailing white-space
  • RCS1038 - Remove empty statement
  • RCS1039 - Remove empty attribute argument list
  • RCS1040 - Remove empty else clause
  • RCS1041 - Remove empty initializer
  • RCS1042 - Remove enum default underlying type
  • RCS1043 - Remove partial modifier from type with a single part
  • RCS1044 - Remove original exception from throw statement
  • RCS1045 - Rename private field according to camel case with underscore
  • RCS1046 - Asynchronous method name should end with 'Async'
  • RCS1047 - Non-asynchronous method name should not end with 'Async'
  • RCS1048 - Use lambda expression instead of anonymous method
  • RCS1049 - Simplify boolean comparison
  • RCS1050 - Add constructor argument list
  • RCS1051 - Parenthesize condition in conditional expression
  • RCS1052 - Declare each attribute separately
  • RCS1054 - Merge local declaration with return statement
  • RCS1055 - Avoid semicolon at the end of declaration
  • RCS1056 - Avoid usage of using alias directive
  • RCS1057 - Add empty line between declarations
  • RCS1058 - Use compound assignment
  • RCS1059 - Avoid locking on publicly accessible instance
  • RCS1060 - Declare each type in separate file
  • RCS1061 - Merge if statement with nested if statement
  • RCS1062 - Avoid interpolated string with no interpolation
  • RCS1063 - Avoid usage of do statement to create an infinite loop
  • RCS1064 - Avoid usage of for statement to create an infinite loop
  • RCS1065 - Avoid usage of while statement to create an inifinite loop
  • RCS1066 - Remove empty finally clause
  • RCS1067 - Remove empty argument list
  • RCS1068 - Simplify logical not expression
  • RCS1069 - Remove unnecessary case label
  • RCS1070 - Remove redundant default switch section
  • RCS1071 - Remove redundant base constructor call
  • RCS1072 - Remove empty namespace declaration
  • RCS1073 - Replace if statement with return statement
  • RCS1074 - Remove redundant constructor
  • RCS1075 - Avoid empty catch clause that catches System.Exception
  • RCS1076 - Format declaration braces
  • RCS1077 - Simplify LINQ method chain
  • RCS1078 - Use "" instead of string.Empty
  • RCS1079 - Throwing of new NotImplementedException
  • RCS1080 - Use 'Count/Length' property instead of 'Any' method
  • RCS1081 - Split variable declaration
  • RCS1082 - Use 'Count/Length' property instead of 'Count' method
  • RCS1083 - Use 'Any' method instead of 'Count' method
  • RCS1084 - Use coalesce expression instead of conditional expression
  • RCS1085 - Use auto-implemented property instead of expanded property
  • RCS1086 - Use linefeed as newline
  • RCS1087 - Use carriage return + linefeed as newline
  • RCS1088 - Use space(s) instead of tab
  • RCS1089 - Use postfix unary operator instead of assignment
  • RCS1090 - Call 'ConfigureAwait(false)'
  • RCS1091 - Remove empty region
  • RCS1092 - Add empty line after last statement in do statement
  • RCS1093 - Remove file with no code
  • RCS1094 - Declare using directive on top level
  • RCS1095 - Use C# 6.0 dictionary initializer
  • RCS1096 - Use bitwise operation instead of calling 'HasFlag'
  • RCS1097 - Remove redundant 'ToString' call
  • RCS1098 - Avoid 'null' on the left side of a binary expression
  • RCS1099 - Default label should be last label in switch section
  • RCS1100 - Format documentation summary on a single line
  • RCS1101 - Format documentation summary on multiple lines
  • RCS1102 - Mark class as static
  • RCS1103 - Replace if statement with assignment
  • RCS1104 - Simplify conditional expression
  • RCS1105 - Merge interpolation into interpolated string
  • RCS1106 - Remove empty destructor
  • RCS1107 - Remove redundant 'ToCharArray' call
  • RCS1108 - Add static modifier to all partial class declarations
  • RCS1109 - Use 'Cast' method instead of 'Select' method
  • RCS1110 - Declare type inside namespace
  • RCS1111 - Add braces to switch section with multiple statements
  • RCS1112 - Combine 'Enumerable.Where' method chain
  • RCS1113 - Use 'string.IsNullOrEmpty' method
  • RCS1114 - Remove redundant delegate creation
  • RCS1115 - Replace yield/return statement with expression statement
  • RCS1116 - Add break statement to switch section
  • RCS1117 - Add return statement that returns default value
  • RCS1118 - Mark local variable as const
  • RCS1119 - Call 'Find' method instead of 'FirstOrDefault' method
  • RCS1120 - Use [] instead of calling 'ElementAt'
  • RCS1121 - Use [] instead of calling 'First'
  • RCS1122 - Add missing semicolon
  • RCS1123 - Add parentheses according to operator precedence
  • RCS1124 - Inline local variable
  • RCS1125 - Mark member as static
  • RCS1126 - Avoid embedded statement in if-else
  • RCS1127 - Merge local declaration with initialization
  • RCS1128 - Use coalesce expression
  • RCS1129 - Remove redundant field initalization
  • RCS1130 - Bitwise operation on enum without Flags attribute
  • RCS1131 - Replace return with yield return
  • RCS1132 - Remove redundant overriding member
  • RCS1133 - Remove redundant Dispose/Close call
  • RCS1134 - Remove redundant continue statement
  • RCS1135 - Declare enum member with zero value (when enum has FlagsAttribute)
  • RCS1136 - Merge switch sections with equivalent content
  • RCS1137 - Add documentation comment to publicly visible type or member
  • RCS1138 - Add summary to documentation comment
  • RCS1139 - Add summary element to documentation comment
  • RCS1140 - Add exception to documentation comment
  • RCS1141 - Add parameter to documentation comment
  • RCS1142 - Add type parameter to documentation comment
  • RCS1143 - Simplify coalesce expression
  • RCS1144 - Mark containing class as abstract
  • RCS1145 - Remove redundant 'as' operator
  • RCS1146 - Use conditional access
  • RCS1147 - Remove inapplicable modifier
  • RCS1148 - Remove unreachable code
  • RCS1149 - Remove implementation from abstract member
  • RCS1150 - Call string.Concat instead of string.Join
  • RCS1151 - Remove redundant cast
  • RCS1152 - Member type must match overriden member type
  • RCS1153 - Add empty line after closing brace
  • RCS1154 - Sort enum members
  • RCS1155 - Use StringComparison when comparing strings
  • RCS1156 - Use string.Length instead of comparison with empty string
  • RCS1157 - Composite enum value contains undefined flag
  • RCS1158 - Avoid static members in generic types
  • RCS1159 - Use EventHandler<T>
  • RCS1160 - Abstract type should not have public constructors
  • RCS1161 - Enum member should declare explicit value
  • RCS1162 - Avoid chain of assignments

List of Refactorings

About

A collection of 160+ analyzers and 170+ refactorings for C#, powered by Roslyn.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C# 99.8%
  • PowerShell 0.2%