Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: rjmurillo/EffectiveCSharp.Analyzers
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v0.1.0
Choose a base ref
...
head repository: rjmurillo/EffectiveCSharp.Analyzers
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v0.2.0-alpha
Choose a head ref
  • 15 commits
  • 44 files changed
  • 4 contributors

Commits on Aug 16, 2024

  1. Merge global config and #55

    rjmurillo committed Aug 16, 2024
    Configuration menu
    Copy the full SHA
    8110117 View commit details
    Browse the repository at this point in the history

Commits on Aug 19, 2024

  1. Configuration menu
    Copy the full SHA
    8efbb14 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    cc11514 View commit details
    Browse the repository at this point in the history
  3. Update SquiggleCop baseline

    rjmurillo committed Aug 19, 2024
    Configuration menu
    Copy the full SHA
    67cf8c7 View commit details
    Browse the repository at this point in the history
  4. Update SquiggleCop baseline

    rjmurillo committed Aug 19, 2024
    Configuration menu
    Copy the full SHA
    e2b85da View commit details
    Browse the repository at this point in the history

Commits on Sep 10, 2024

  1. 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>
    3 people authored Sep 10, 2024
    Configuration menu
    Copy the full SHA
    75e6c1b View commit details
    Browse the repository at this point in the history
  2. Update baseline.json to latest suite change commit

    Signed-off-by: Richard Murillo <rjmurillo@gmail.com>
    rjmurillo authored Sep 10, 2024
    Configuration menu
    Copy the full SHA
    07db1f9 View commit details
    Browse the repository at this point in the history
  3. 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>
    rjmurillo authored Sep 10, 2024
    Configuration menu
    Copy the full SHA
    4df417e View commit details
    Browse the repository at this point in the history

Commits on Sep 26, 2024

  1. Add Item 17: update configuration to enable CA1063 as warning (#67)

    Updates the shipping `.globalconfig` to enable CA1063 as Warning
    
    Resolves #60
    rjmurillo authored Sep 26, 2024
    Configuration menu
    Copy the full SHA
    97d2ddc View commit details
    Browse the repository at this point in the history
  2. 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
    rjmurillo authored Sep 26, 2024
    Configuration menu
    Copy the full SHA
    9144e7c View commit details
    Browse the repository at this point in the history
  3. Add Item 16: Do not call overridable methods in constructors (#68)

    Update `.globalconfig` to enable CA2214 with Warning severity
    
    Closes #59
    rjmurillo authored Sep 26, 2024
    Configuration menu
    Copy the full SHA
    6e309b8 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    4f81c72 View commit details
    Browse the repository at this point in the history

Commits on Sep 28, 2024

  1. 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>
    rjmurillo and coderabbitai[bot] authored Sep 28, 2024
    Configuration menu
    Copy the full SHA
    6724bf3 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    de327e4 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    2a3bc76 View commit details
    Browse the repository at this point in the history
Loading