-
Notifications
You must be signed in to change notification settings - Fork 1
Comparing changes
Open a pull request
base repository: rjmurillo/EffectiveCSharp.Analyzers
base: v0.1.0
head repository: rjmurillo/EffectiveCSharp.Analyzers
compare: v0.2.0-alpha
- 15 commits
- 44 files changed
- 4 contributors
Commits on Aug 16, 2024
-
Configuration menu - View commit details
-
Copy full SHA for 8110117 - Browse repository at this point
Copy the full SHA 8110117View commit details
Commits on Aug 19, 2024
-
Configuration menu - View commit details
-
Copy full SHA for 8efbb14 - Browse repository at this point
Copy the full SHA 8efbb14View commit details -
Configuration menu - View commit details
-
Copy full SHA for cc11514 - Browse repository at this point
Copy the full SHA cc11514View commit details -
Configuration menu - View commit details
-
Copy full SHA for 67cf8c7 - Browse repository at this point
Copy the full SHA 67cf8c7View commit details -
Configuration menu - View commit details
-
Copy full SHA for e2b85da - Browse repository at this point
Copy the full SHA e2b85daView commit details
Commits on Sep 10, 2024
-
Add Item 12: Prefer Member Initializers to Assignment Statements (#63)
This pull request is based on #62 (thanks @rorozcov!) and introduces a new Roslyn analyzer to enforce best practices for member initializers and assignment statements in C#. The analyzer identifies cases where a member variable and constructor have duplicate or divergent logic, leading to extra work being done by the runtime. ## Changes - Analyzer: `PreferMemberInitializerAnalyzer`: - Detects duplicate member variable assignment and initialization - Detects member variable assignment from a constructor that could be done at declaration - Accounts for complex control flow and variable usage to limit false positives - Code fix provider: None - The initialization logic of applications can be complex and a code fix provider can be complex to capture all cases of remediation. This implementation only shows areas of potential duplication. - Tests: Comprehensive unit tests covering various scenarios This analyzer aligns modern C# and .NET practices, particularly [CA1805: Do not initialize unnecessarily](https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca1805) and Effective C# Item 12: Prefer member initializers to assignment statements. Closes #36 <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - Introduced a new diagnostic analyzer to enforce the use of member initializers over assignment statements in constructors, improving code clarity and maintainability. - Added performance benchmarking capabilities for the new analyzer. - **Documentation** - Added guidelines for the new coding rule (ECS1200) emphasizing member initializers, including examples and best practices. - **Bug Fixes** - Enhanced diagnostic capabilities to accurately identify redundant initializations and improve overall code quality. - **Tests** - Implemented a comprehensive suite of unit tests for the new analyzer, covering various initialization scenarios and ensuring adherence to best practices. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Signed-off-by: Rodolfo Orozco Vasquez <44987991+rorozcov@users.noreply.github.com> Co-authored-by: Rodolfo Orozco Vasquez <44987991+rorozco1997@users.noreply.github.com> Co-authored-by: Rodolfo Orozco Vasquez <44987991+rorozcov@users.noreply.github.com>
Configuration menu - View commit details
-
Copy full SHA for 75e6c1b - Browse repository at this point
Copy the full SHA 75e6c1bView commit details -
Update baseline.json to latest suite change commit
Signed-off-by: Richard Murillo <rjmurillo@gmail.com>
Configuration menu - View commit details
-
Copy full SHA for 07db1f9 - Browse repository at this point
Copy the full SHA 07db1f9View commit details -
Update RunPerfTests.ps1 to enable roll-forward (#65)
Enhanced performance testing flexibility by allowing the .NET runtime to select compatible framework versions with the addition of the `--roll-forward Major` option. Fixes #64 Signed-off-by: Richard Murillo <rjmurillo@gmail.com>
Configuration menu - View commit details
-
Copy full SHA for 4df417e - Browse repository at this point
Copy the full SHA 4df417eView commit details
Commits on Sep 26, 2024
-
Add Item 17: update configuration to enable CA1063 as warning (#67)
Updates the shipping `.globalconfig` to enable CA1063 as Warning Resolves #60
Configuration menu - View commit details
-
Copy full SHA for 97d2ddc - Browse repository at this point
Copy the full SHA 97d2ddcView commit details -
Add Item 13: Use proper initialization for static class members (#66)
This pull request introduced a new Roslyn analyzer to enforce best practices for static member initializers and assignments in C#. The analyzer identifies cases where a member variable is static and complex, indicating it should move to the type's static constructor. ## Changes - Analyzer `StaticClassMemberInitializationAnalyzer`: - Detects `static` member variable assignment and initialization - Detects member variable assignment from methods, suggesting complex cases move to the type's static constructor - Code fix provider: None - The initialization logic of applications can be complex and a code fix provider can be equally complex to capture all cases of remediation. This implementation only shows areas of potential issue. - Tests: Added comprehensive unit tests for the new static class member initialization analyzer to ensure proper functionality and coverage. Includes benchmarking tests to evaluate the performance of the static member initialization analyzer. Closed #56
Configuration menu - View commit details
-
Copy full SHA for 9144e7c - Browse repository at this point
Copy the full SHA 9144e7cView commit details -
Add Item 16: Do not call overridable methods in constructors (#68)
Update `.globalconfig` to enable CA2214 with Warning severity Closes #59
Configuration menu - View commit details
-
Copy full SHA for 6e309b8 - Browse repository at this point
Copy the full SHA 6e309b8View commit details -
Configuration menu - View commit details
-
Copy full SHA for 4f81c72 - Browse repository at this point
Copy the full SHA 4f81c72View commit details
Commits on Sep 28, 2024
-
Add Item 14: Minimize initialization logic (#70)
This pull request introduces a new Roslyn analyzer to enforce best practices for C# constructors. The analyzer identifies cases where a constructor contains duplicate initialization logic as another constructor. ## Changes - Analyzer: `MinimizeDuplicateInitializationLogicAnalyzer`: - Detects duplicate initialization statements - Code fix provider: None - The initialization logic of applications can be complex and a code fix provider can be equally complex to capture all cases of remediation. This implementation only shows areas of potential duplication. - Tests: Unit tests covering various positive and negative cases Closes #57 --------- Signed-off-by: Richard Murillo <rjmurillo@gmail.com> Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Configuration menu - View commit details
-
Copy full SHA for 6724bf3 - Browse repository at this point
Copy the full SHA 6724bf3View commit details -
Configuration menu - View commit details
-
Copy full SHA for de327e4 - Browse repository at this point
Copy the full SHA de327e4View commit details -
Configuration menu - View commit details
-
Copy full SHA for 2a3bc76 - Browse repository at this point
Copy the full SHA 2a3bc76View commit details
This comparison is taking too long to generate.
Unfortunately it looks like we can’t render this comparison for you right now. It might be too big, or there might be something weird with your repository.
You can try running this command locally to see the comparison on your machine:
git diff v0.1.0...v0.2.0-alpha