Redundancy code quality
ProprietaryRemove redundant code from C# sources.
OpenRewrite. Recipes. CSharp. CodeQuality. Redundancy. RedundancyCodeQualitymod run . --recipe= OpenRewrite. Recipes. CSharp. CodeQuality. Redundancy. RedundancyCodeQualityInstall it once, then run it on every repository under the current directory. New to the Moderne CLI? Set it up.
Recipe list
It runs these recipes, in this order.
- Remove redundant ToString() call
- Use rethrow instead of throw ex
- Remove empty finally clause
- Remove unnecessary else clause
- Remove redundant ToCharArray() call
- Remove redundant parentheses
- Remove redundant cast
- Remove redundant default field initialization
- Remove redundant base constructor call
- Remove redundant sealed modifier
- Find empty catch clause
- Remove empty foreach body
- Remove empty while body
- Remove redundant async/await
- Remove unused member declaration
- Remove redundant overriding member
- Remove redundant Dispose/Close call
- Remove redundant region
- Flag empty for loop body
- Remove empty destructor
- Remove redundant auto-property initialization
- Remove redundant statement
- Remove redundant delegate creation
- Remove redundant assignment
- Remove unnecessary interpolated string
- Remove redundant catch block
- Remove unnecessary case label
- Remove redundant default switch section
- Remove redundant base interface
- Remove unnecessary unsafe context
- Remove unnecessary null-forgiving operator
- Find empty syntax
- Remove partial modifier from single-part type
- Remove enum default underlying type
- Remove argument list from attribute
- Remove redundant as operator
- Remove unnecessary verbatim string literal
- Remove unnecessary null check
- Remove unnecessary raw string literal
- Remove redundant constructor
- Unused 'this' parameter
- Unused element in documentation comment
- Unnecessary enum flag
- Remove redundant 'sealed' modifier from override
- Remove unnecessary semicolon at end of declaration
- File contains no code
- Unnecessary interpolation
- Resource can be disposed asynchronously
- Remove explicit 'class' from record
- Find internal types that may be unused