All Features

C# Refactorings103

  • Adds another accessor (AddAnotherAccessorCodeRefactoringProvider)
  • Add braces (AddBracesCodeRefactoringProvider)
  • 'catch' to 'catch (Exception)' (AddCatchExceptionCodeRefactoringProvider)
  • Add an exception description to the xml documentation (AddExceptionDescriptionCodeRefactoringProvider)
  • Add name for argument (AddNameToArgumentCodeRefactoringProvider)
  • Introduce format item (AddNewFormatItemCodeRefactoringProvider)
  • Add null check (AddNullCheckCodeRefactoringProvider)
  • Add one or more optional parameters to an invocation, using their default values (AddOptionalParameterToInvocationCodeRefactoringProvider)
  • Check array index value (CheckArrayIndexValueCodeRefactoringProvider)
  • Check collection index value (CheckCollectionIndexValueCodeRefactoringProvider)
  • Check dictionary key value (CheckDictionaryKeyValueCodeRefactoringProvider)
  • Check if parameter is null (CheckIfParameterIsNullCodeRefactoringProvider)
  • Check StringBuilder index value (CheckStringBuilderIndexValueCodeRefactoringProvider)
  • Check string index value (CheckStringIndexValueCodeRefactoringProvider)
  • Compute constant value (ComputeConstantValueCodeRefactoringProvider)
  • Add a Contract to specify the return value must not be null (ContractEnsuresNotNullReturnCodeRefactoringProvider)
  • Add a Contract to specify the parameter must not be null (ContractRequiresNotNullCodeRefactoringProvider)
  • Convert anonymous method to lambda expression (ConvertAnonymousMethodToLambdaCodeRefactoringProvider)
  • Convert auto-property to computed propertyy (ConvertAutoPropertyToPropertyCodeRefactoringProvider)
  • Replace bitwise flag comparison with call to 'Enum.HasFlag' (ConvertBitwiseFlagComparisonToHasFlagsCodeRefactoringProvider)
  • Convert '??' to '?:' (ConvertCoalescingToConditionalExpressionCodeRefactoringProvider)
  • Convert dec to hex. (ConvertDecToHexCodeRefactoringProvider)
  • Convert do...while to while (ConvertDoWhileToWhileLoopCodeRefactoringProvider)
  • Convert '==' to 'object.Equals()' (ConvertEqualityOperatorToEqualsCodeRefactoringProvider)
  • Convert '==' to 'object.ReferenceEquals()' (ConvertEqualityOperatorToReferenceEqualsCodeRefactoringProvider)
  • Convert 'Equals' call to '==' or '!=' (ConvertEqualsToEqualityOperatorCodeRefactoringProvider)
  • Convert explicit to implict implementation (ConvertExplicitToImplicitImplementationCodeRefactoringProvider)
  • Convert expression body member to statement body (ConvertExpressionBodyToStatementBodyCodeRefactoringProvider)
  • Convert 'foreach' loop to 'for' (ConvertForeachToForCodeRefactoringProvider)
  • Convert 'for' loop to 'while' (ConvertForToWhileCodeRefactoringProvider)
  • Replace 'Enum.HasFlag' call with bitwise flag comparison (ConvertHasFlagsToBitwiseFlagComparisonCodeRefactoringProvider)
  • Convert hex to dec. (ConvertHexToDecCodeRefactoringProvider)
  • Convert 'if' to '?:' (ConvertIfStatementToConditionalTernaryExpressionCodeRefactoringProvider)
  • Convert 'if' to '??' expression (ConvertIfStatementToNullCoalescingExpressionAction)
  • Convert 'if' to 'return' (ConvertIfStatementToReturnStatementAction)
  • Convert 'if' to 'switch' (ConvertIfStatementToSwitchStatementCodeRefactoringProvider)
  • Convert implict to explicit implementation (ConvertImplicitToExplicitImplementationCodeRefactoringProvider)
  • Convert instance to static method (ConvertInstanceToStaticMethodCodeRefactoringProvider)
  • Convert string interpolation to 'string.Format' (ConvertInterpolatedStringToStringFormatCodeRefactoringProvider)
  • Converts expression of lambda body to statement (ConvertLambdaBodyExpressionToStatementCodeRefactoringProvider)
  • Converts statement of lambda body to expression (ConvertLambdaStatementToExpressionCodeRefactoringProvider)
  • Convert lambda to anonymous method (ConvertLambdaToAnonymousMethodCodeRefactoringProvider)
  • Convert method group to anoymous method (ConvertMethodGroupToAnonymousMethodCodeRefactoringProvider)
  • Convert method group to lambda expression (ConvertMethodGroupToLambdaCodeRefactoringProvider)
  • Convert '*'/'/' to '<<'/'>>' (ConvertMultiplyToShiftCodeRefactoringProvider)
  • Convert 'ReferenceEquals' call to '==' or '!=' (ConvertReferenceEqualsToEqualityOperatorCodeRefactoringProvider)
  • Convert '<<'/'>>' to '*'/'/' (ConvertShiftToMultiplyCodeRefactoringProvider)
  • Convert statement body member to expression body (ConvertStatementBodyToExpressionBodyCodeRefactoringProvider)
  • Convert 'string.Format' to string interpolation (ConvertStringFormatToInterpolatedStringCodeRefactoringProvider)
  • Convert 'switch' to 'if' (ConvertSwitchToIfCodeRefactoringProvider)
  • Convert 'return' to 'if' (ConvertTernaryExpressionToIfStatementCodeRefactoringProvider)
  • Convert while loop to do...while (ConvertWhileToDoWhileLoopCodeRefactoringProvider)
  • Copy comments from base (CopyCommentsFromBaseCodeRefactoringProvider)
  • Create changed event for property (CreateChangedEventCodeRefactoringProvider)
  • Create custom event implementation (CreateCustomEventImplementationAction)
  • Create delegate (CreateDelegateAction)
  • Create event invocator (CreateEventInvocatorCodeRefactoringProvider)
  • Create overload without parameter (CreateOverloadWithoutParameterCodeRefactoringProvider)
  • Extract anonymous method (ExtractAnonymousMethodCodeRefactoringProvider)
  • Extract field (ExtractWhileConditionToInternalIfStatementCodeRefactoringProvider)
  • Swap 'Equals' target and argument (FlipEqualsTargetAndArgumentCodeRefactoringProvider)
  • Flip an operator operands (FlipOperatorArgumentsCodeRefactoringProvider)
  • Flip an relational operator operands (FlipRelationalOperatorArgumentsCodeRefactoringProvider)
  • Generate switch labels (GenerateSwitchLabelsCodeRefactoringProvider)
  • Import static class with using directive in file (ImportStaticClassWithUsingCodeRefactoringProvider)
  • Initialize auto property from constructor parameter (InitializeAutoPropertyFromConstructorParameterCodeRefactoringProvider)
  • Initialize field from constructor parameter (InitializeFieldFromConstructorParameterCodeRefactoringProvider)
  • Insert anonymous method signature (InsertAnonymousMethodSignatureCodeRefactoringProvider)
  • Invert conditional operator (InvertConditionalOperatorCodeRefactoringProvider)
  • Invert if (InvertIfCodeRefactoringProvider)
  • Invert logical expression (InvertLogicalExpressionCodeRefactoringProvider)
  • Invoke as static method (InvokeAsStaticMethodCodeRefactoringProvider)
  • Iterate via 'foreach' (IterateViaForeachAction)
  • Join local variable declaration and assignment (JoinLocalVariableDeclarationAndAssignmentCodeRefactoringProvider)
  • Join string literal (JoinStringCodeRefactoringProvider)
  • Merge nested 'if' (MergeNestedIfAction)
  • Negate 'is' expression (NegateIsExpressionCodeRefactoringProvider)
  • Negate a relational expression (NegateLogicalExpressionCodeRefactoringProvider)
  • put inside 'using' (PutInsideUsingAction)
  • Remove braces (RemoveBracesCodeRefactoringProvider)
  • 'catch (Exception)' to 'catch' (RemoveCatchExceptionCodeRefactoringProvider)
  • Remove #region/#endregion directives (RemoveRegionEndRegionDirectivesCodeRefactoringProvider)
  • Replace assignment with postfix expression (ReplaceAssignmentWithPostfixExpressionCodeRefactoringProvider)
  • Replace auto-property with property that uses a backing field (ReplaceAutoPropertyWithPropertyAndBackingFieldCodeRefactoringProvider)
  • Convert cast to 'as'. (ReplaceDirectCastWithSafeCastCodeRefactoringProvider)
  • Replace type with 'var' (ReplaceExplicitTypeWithVarCodeRefactoringProvider)
  • Replace operator assignment with assignment (ReplaceOperatorAssignmentWithAssignmentCodeRefactoringProvider)
  • Replace postfix expression with assignment (ReplacePostfixExpressionWithAssignmentCodeRefactoringProvider)
  • Replace property that uses a backing field with auto-property (ReplacePropertyWithBackingFieldWithAutoPropertyCodeRefactoringProvider)
  • Convert 'as' to cast. (ReplaceSafeCastWithDirectCastCodeRefactoringProvider)
  • Replaces 'var' with explicit type specification (ReplaceVarWithExplicitTypeCodeRefactoringProvider)
  • Replace assignment with operator assignment (ReplaceWithOperatorAssignmentCodeRefactoringProvider)
  • Reverse the direction of a for (ReverseDirectionForForLoopCodeRefactoringProvider)
  • Split declaration list (SplitDeclarationListCodeRefactoringProvider)
  • Split 'if' with '&&' condition in two nested 'if' statements (SplitIfWithAndConditionInTwoCodeRefactoringProvider)
  • Split 'if' with '||' condition in two 'if' statements (SplitIfWithOrConditionInTwoCodeRefactoringProvider)
  • Split local variable declaration and assignment (SplitLocalVariableDeclarationAndAssignmentCodeRefactoringProvider)
  • Split string literal (SplitStringCodeRefactoringProvider)
  • Make abstract member virtual (ToAbstractVirtualNonVirtualConversionCodeRefactoringProvider)
  • Use 'as' and check for null (UseAsAndNullCheckCodeRefactoringProvider)
  • Use string.Format() (UseStringFormatAction)
  • Use System.Environment.NewLine (UseSystemEnvironmentNewLineCodeRefactoringProvider)
  • Use string.Empty (UseSystemStringEmptyCodeRefactoringProvider)

C# Analyzers119

  • Suggests using the class declaring a static function when calling it (AccessToStaticMemberViaDerivedTypeAnalyzer)
  • When initializing explicitly typed local variable or array type, array creation expression can be replaced with array initializer. (ArrayCreationCanBeReplacedWithArrayInitializerAnalyzer)
  • Asynchronous methods should return a Task instead of void (AvoidAsyncVoidAnalyzer)
  • Base parameter has 'params' modifier, but missing in overrider (BaseMemberHasParamsAnalyzer)
  • Call to base member with implicit default parameters (BaseMethodCallWithDefaultParameterAnalyzer)
  • Parameter name differs in base declaration (BaseMethodParameterNameMismatchAnalyzer)
  • Bitwise operation on enum which has no [Flags] attribute (BitwiseOperatorOnEnumWithoutFlagsAnalyzer)
  • Finds potentially erroneous calls to Object.Equals (CallToObjectEqualsViaBaseAnalyzer)
  • Possible compare of value type with 'null' (CompareNonConstrainedGenericWithNullAnalyzer)
  • Comparison of floating point numbers with equality operator (CompareOfFloatsByEqualityOperatorAnalyzer)
  • '?:' expression has identical true and false branches (ConditionalTernaryEqualBranchAnalyzer)
  • Expression is always 'true' or always 'false' (ConditionIsAlwaysTrueOrFalseAnalyzer)
  • Condition is always 'true' or always 'false' (ConstantConditionAnalyzer)
  • Finds redundant null coalescing expressions such as expr ?? expr (ConstantNullCoalescingConditionAnalyzer)
  • Convert anonymous method to method group (ConvertClosureToMethodGroupAnalyzer)
  • '?:' expression can be converted to '??' expression (ConvertConditionalTernaryToNullCoalescingAnalyzer)
  • Convert 'if-do-while' to 'while' statement (ConvertIfDoToWhileAnalyzer)
  • 'if' statement can be re-written as 'switch' statement (ConvertIfStatementToSwitchStatementAnalyzer)
  • Convert 'if' to '&&' expression (ConvertIfToAndExpressionAnalyzer)
  • Convert 'if' to '||' expression (ConvertIfToOrExpressionAnalyzer)
  • Convert 'Nullable<T>' to the short form 'T?' (ConvertNullableToShortFormAnalyzer)
  • If all fields, properties and methods members are static, the class can be made static. (ConvertToStaticTypeAnalyzer)
  • Delegate subtraction has unpredictable result (DelegateSubtractionAnalyzer)
  • Warns about calls to virtual member functions occuring in the constructor (DoNotCallOverridableMethodsInConstructorAnalyzer)
  • Double negation is redundant (DoubleNegationOperatorAnalyzer)
  • An empty public constructor without paramaters is redundant. (EmptyConstructorAnalyzer)
  • Empty destructor is redundant (EmptyDestructorAnalyzer)
  • Empty control statement body (EmptyEmbeddedStatementAnalyzer)
  • A catch clause that catches System.Exception and has an empty body (EmptyGeneralCatchClauseAnalyzer)
  • Empty namespace declaration is redundant (EmptyNamespaceAnalyzer)
  • Empty statement is redundant (EmptyStatementAnalyzer)
  • The default underlying type of enums is int, so defining it explicitly is redundant. (EnumUnderlyingTypeIsIntAnalyzer)
  • Comparing equal expression for equality is usually useless (EqualExpressionComparisonAnalyzer)
  • Event unsubscription via anonymous delegate is useless (EventUnsubscriptionViaAnonymousDelegateAnalyzer)
  • Convert field to readonly (FieldCanBeMadeReadOnlyAnalyzer)
  • 'for' loop control variable is never modified (ForControlVariableIsNeverModifiedAnalyzer)
  • Finds issues with format strings (FormatStringProblemAnalyzer)
  • 'true' is redundant as for statement condition (ForStatementConditionIsTrueAnalyzer)
  • Function does not reach its end or a 'return' statement by any of possible execution paths (FunctionNeverReturnsAnalyzer)
  • If an extension method is called as static method convert it to method syntax (InvokeAsExtensionMethodAnalyzer)
  • Local variable has the same name as a member and hides it (LocalVariableHidesMemberAnalyzer)
  • Local variable is never used (LocalVariableNotUsedAnalyzer)
  • Lowercase 'l' is often confused with '1' (LongLiteralEndingLowerLAnalyzer)
  • Member hides static member from outer class (MemberHidesStaticFromOuterClassAnalyzer)
  • Method with optional parameter is hidden by overload (MethodOverloadWithOptionalParameterAnalyzer)
  • Suggest the usage of the nameof operator (NameOfSuggestionAnalyzer)
  • Non public methods are not found by NUnit (NonPublicMethodWithTestAttributeAnalyzer)
  • Shows NotImplementedException throws in the quick task bar (NotImplementedExceptionAnalyzer)
  • Cannot resolve symbol in text argument (NotResolvedInTextAnalyzer)
  • Possible unassigned object created by 'new' (ObjectCreationAsStatementAnalyzer)
  • Operator Is can be used instead of comparing object GetType() and instances of System.Type object (OperatorIsCanBeUsedAnalyzer)
  • C# doesn't support optional 'ref' or 'out' parameters (OptionalParameterRefOutAnalyzer)
  • Parameter has the same name as a member and hides it (ParameterHidesMemberAnalyzer)
  • Parameter is assigned but its value is never used (ParameterOnlyAssignedAnalyzer)
  • Parameter name differs in partial method definition (PartialMethodParameterNameMismatchAnalyzer)
  • Class is declared partial but has only one part (PartialTypeWithSinglePartAnalyzer)
  • Possible mistaken call to 'object.GetType()' (PossibleMistakenCallToGetTypeAnalyzer)
  • Constructor in abstract class should not be public (PublicConstructorInAbstractClassAnalyzer)
  • Redundant explicit property name (RedundantAnonymousTypePropertyNameAnalyzer)
  • Redundant explicit argument name specification (RedundantArgumentNameAnalyzer)
  • Parentheses are redundant if attribute has no arguments (RedundantAttributeParenthesesAnalyzer)
  • This is generated by the compiler and can be safely removed (RedundantBaseConstructorCallAnalyzer)
  • 'base.' is redundant and can safely be removed (RedundantBaseQualifierAnalyzer)
  • Redundant case label (RedundantCaseLabelAnalyzer)
  • Check for inequality before assignment is redundant if (x != value) x = value; (RedundantCheckBeforeAssignmentAnalyzer)
  • Redundant comma in array initializer (RedundantCommaInArrayInitializerAnalyzer)
  • Initializing field with default value is redundant (RedundantDefaultFieldInitializerAnalyzer)
  • Explicit delegate creation expression is redundant (RedundantDelegateCreationAnalyzer)
  • Redundant empty 'default' switch branch (RedundantEmptyDefaultSwitchBranchAnalyzer)
  • Redundant empty finally block (RedundantEmptyFinallyBlockAnalyzer)
  • Redundant explicit size in array creation (RedundantExplicitArraySizeAnalyzer)
  • Value types are implicitly convertible to nullables (RedundantExplicitNullableCreationAnalyzer)
  • Redundant 'else' keyword (RedundantIfElseBlockAnalyzer)
  • Removes 'internal' modifiers that are not required (RedundantInternalAnalyzer)
  • When object creation uses object or collection initializer, empty argument list is redundant (RedundantObjectCreationArgumentListAnalyzer)
  • Removes 'private' modifiers that are not required (RedundantPrivateAnalyzer)
  • Redundant 'string.ToCharArray()' call (RedundantStringToCharArrayCallAnalyzer)
  • Redundant conditional expression (RedundantTernaryExpressionAnalyzer)
  • RedundantToStringCallAnalyzer
  • Unsafe modifier in redundant in unsafe context or when no unsafe constructs are used (RedundantUnsafeContextAnalyzer)
  • Remove redundant statement (RemoveRedundantOrStatementAnalyzer)
  • Replace with call to FirstOrDefault<T>() (ReplaceWithFirstOrDefaultAnalyzer)
  • Replace with call to LastOrDefault<T>() (ReplaceWithLastOrDefaultAnalyzer)
  • Replace with call to OfType<T> (ReplaceWithOfTypeAnalyzer)
  • Replace with call to OfType<T>().Any() (ReplaceWithOfTypeAnyAnalyzer)
  • Replace with call to OfType<T>().Count() (ReplaceWithOfTypeCountAnalyzer)
  • Replace with call to OfType<T>().First() (ReplaceWithOfTypeFirstAnalyzer)
  • Replace with call to OfType<T>().FirstOrDefault() (ReplaceWithOfTypeFirstOrDefaultAnalyzer)
  • Replace with call to OfType<T>().Last() (ReplaceWithOfTypeLastAnalyzer)
  • Replace with call to OfType<T>().LastOrDefault() (ReplaceWithOfTypeLastOrDefaultAnalyzer)
  • Replace with call to OfType<T>().LongCount() (ReplaceWithOfTypeLongCountAnalyzer)
  • Replace with call to OfType<T>().Single() (ReplaceWithOfTypeSingleAnalyzer)
  • Replace with call to OfType<T>().SingleOrDefault() (ReplaceWithOfTypeSingleOrDefaultAnalyzer)
  • Replace with call to OfType<T>().Where() (ReplaceWithOfTypeWhereAnalyzer)
  • Replace with simple assignment (ReplaceWithSimpleAssignmentAnalyzer)
  • Redundant Where() call with predicate followed by Any() (ReplaceWithSingleCallToAnyAnalyzer)
  • Redundant Where() call with predicate followed by Count() (ReplaceWithSingleCallToCountAnalyzer)
  • Redundant Where() call with predicate followed by First() (ReplaceWithSingleCallToFirstAnalyzer)
  • Redundant Where() call with predicate followed by FirstOrDefault() (ReplaceWithSingleCallToFirstOrDefaultAnalyzer)
  • Redundant Where() call with predicate followed by Last() (ReplaceWithSingleCallToLastAnalyzer)
  • Redundant Where() call with predicate followed by LastOrDefault() (ReplaceWithSingleCallToLastOrDefaultAnalyzer)
  • Redundant Where() call with predicate followed by LongCount() (ReplaceWithSingleCallToLongCountAnalyzer)
  • Redundant Where() call with predicate followed by Single() (ReplaceWithSingleCallToSingleAnalyzer)
  • Redundant Where() call with predicate followed by SingleOrDefault() (ReplaceWithSingleCallToSingleOrDefaultAnalyzer)
  • Uses shorter string.IsNullOrEmpty call instead of a longer condition (ReplaceWithStringIsNullOrEmptyAnalyzer)
  • Unallowed usage of Roslyn features in this context. (RoslynUsageAnalyzer)
  • 'sealed' modifier is redundant in sealed classes (SealedMemberInSealedClassAnalyzer)
  • Conditional expression can be simplified (SimplifyConditionalTernaryExpressionAnalyzer)
  • Warns about static fields in generic types (StaticFieldOrAutoPropertyInGenericTypeAnalyzer)
  • Warns when a culture-aware 'string.CompareTo' call is used by default (StringCompareToIsCultureSpecificAnalyzer)
  • Warns when a culture-aware 'EndsWith' call is used by default. (StringEndsWithIsCultureSpecificAnalyzer)
  • Warns when a culture-aware 'IndexOf' call is used by default. (StringIndexOfIsCultureSpecificAnalyzer)
  • Warns when a culture-aware 'LastIndexOf' call is used by default. (StringLastIndexOfIsCultureSpecificAnalyzer)
  • Warns when a culture-aware 'StartsWith' call is used by default. (StringStartsWithIsCultureSpecificAnalyzer)
  • Use 'var' keyword when possible (SuggestUseVarKeywordEvidentAnalyzer)
  • [ThreadStatic] doesn't work with instance fields (ThreadStaticAtInstanceFieldAnalyzer)
  • Type parameter is never used (UnusedTypeParameterAnalyzer)
  • Warns about property or indexer setters and event adders or removers that do not use the value parameter (ValueParameterNotUsedAnalyzer)
  • Validate Xml docs (XmlDocAnalyzer)

C# Fixes9

  • CS0108UseNewKeywordIfHidingIntendedCodeFixProvider
  • CS0152DuplicateCaseLabelValueCodeFixProvider
  • CS0162UnreachableCodeDetectedCodeFixProvider
  • CS0164LabelHasNotBeenReferencedCodeFixProvider
  • CS0759RedundantPartialMethodCodeFixProvider
  • CS1105ExtensionMethodMustBeDeclaredStaticCodeFixProvider
  • CS1520MethodMustHaveAReturnTypeCodeFixProvider
  • InvalidConversionCodeFixProvider
  • ReturnMustNotBeFollowedByAnyExpressionCodeFixProvider

VB Refactorings19

  • Adds another accessor (AddAnotherAccessorCodeRefactoringProvider)
  • Add check for Nothing (AddCheckForNothingCodeRefactoringProvider)
  • Check dictionary key value (CheckDictionaryKeyValueCodeRefactoringProvider)
  • Check if parameter is Nothing (CheckIfParameterIsNothingCodeRefactoringProvider)
  • Compute constant value (ComputeConstantValueCodeRefactoringProvider)
  • Convert dec to hex. (ConvertDecToHexCodeRefactoringProvider)
  • Convert Do...Loop While/Until to Do While/Until...Loop (ConvertDoLoopWhileToDoWhileLoopCodeRefactoringProvider)
  • Convert Do While/Until...Loop to Do...Loop While/Until (ConvertDoWhileLoopToDoLoopWhileCodeRefactoringProvider)
  • Convert hex to dec. (ConvertHexToDecCodeRefactoringProvider)
  • Convert 'If' to 'Select Case' (ConvertIfStatementToSelectCaseStatementCodeRefactoringProvider)
  • Convert 'Select Case' to 'If' (ConvertSelectCaseToIfCodeRefactoringProvider)
  • Convert to custom event (ConvertToCustomEventCodeRefactoringProvider)
  • Copy comments from base (CopyCommentsFromBaseCodeRefactoringProvider)
  • Create changed event for property (CreateChangedEventCodeRefactoringProvider)
  • Create overload without parameter (CreateOverloadWithoutParameterCodeRefactoringProvider)
  • Invert if (InvertIfCodeRefactoringProvider)
  • Invert logical expression (InvertLogicalExpressionCodeRefactoringProvider)
  • Convert cast to 'TryCast'. (ReplaceDirectCastWithSafeCastCodeRefactoringProvider)
  • Convert 'TryCast' to cast. (ReplaceSafeCastWithDirectCastCodeRefactoringProvider)

VB Analyzers2

  • Suggest the usage of the NameOf operator (NameOfSuggestionAnalyzer)
  • Non public methods are not found by NUnit (NonPublicMethodWithTestAttributeAnalyzer)