# mehdiway/codequalityenforcer architecture

> Architecture diagram of the GitHub repository mehdiway/codequalityenforcer, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-01-17). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/mehdiway/codequalityenforcer
- Repository: https://github.com/mehdiway/codequalityenforcer

## Overview

Key Components to Include:

##### Main System Components
- Roslyn Analyzer Integration
- Rule Enforcement Engine
- Build Process Integration
- Project Configuration

##### Component Relationships

A. Core Components (Top Level):

##### Inside this container, create these primary components

a) Analyzer Engine (Central):
- It as a hexagon to indicate it's the core processing unit

b) Rule Processors (Right side):
- Create two connected modules:
- "Nullable Reference Type Enforcer"
- "Method Complexity Analyzer"
- Use rectangles for these components

c) Build Integration (Left side):
- A component for ".NET Build Pipeline Integration"
- Connection to MSBuild using the props file

##### Source Code Input
- Direction: External → Analyzer Engine

##### Output Flow
- Use red for errors, yellow for warnings

C. Integration Points:

##### "Roslyn Compiler Integration"
- How it interfaces with the analyzer engine
- It's part of the compilation process

D. Special Considerations:

##### Version compatibility
- ".NET Core 3.1+ / .NET 5+"
- "C# 8.0+" requirement

E. Technical Details to Include:

##### Zero-dependency nature
- "No Runtime Dependencies" in a note

##### Rule Configuration
- A small component showing the complexity limit of 15
- Nullable reference type settings

##### Callouts explaining
- How the analyzer integrates with the build process
- The error generation mechanism
- Rule enforcement strategy

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph CodeQualityEnforcer
        AE[("Roslyn Analyzer Engine")]
        NRE["Nullable Reference Type Enforcer"]
        MCA["Method Complexity Analyzer"]
        BPI["Build Process Integration"]
        CI["Compiler Integration"]
        MSB["MSBuild Integration"]
        
        subgraph RuleProcessors
            NRE
            MCA
        end
        
        subgraph BuildSystem
            BPI
            MSB
        end
    end
    
    SRC["C# Source Files"]
    COMP["Compilation Process"]
    OUT["Compiler Errors/Warnings"]:::error
    
    SRC --> AE
    AE <--> NRE
    AE <--> MCA
    AE --> BPI
    BPI --> OUT
    MSB --> BPI
    CI --> AE
    COMP --> CI
    
    %% Component Relationships
    classDef default fill:#f9f9f9,stroke:#333,stroke-width:1px
    classDef core fill:#b3d1ff,stroke:#333
    classDef rule fill:#90EE90,stroke:#333
    classDef external fill:#d3d3d3,stroke:#333
    classDef error fill:#ffcccb,stroke:#333
    
    class AE core
    class NRE,MCA rule
    class SRC,COMP external
    class OUT error
    
    %% Click Events
    click AE "https://github.com/Mehdiway/CodeQualityEnforcer/tree/master/analyzers/dotnet/cs/"
    click MCA "https://github.com/Mehdiway/CodeQualityEnforcer/blob/master/analyzers/dotnet/cs/MethodComplexityAnalyzer.cs"
    click BPI "https://github.com/Mehdiway/CodeQualityEnforcer/blob/master/build/CodeQualityEnforcer.props"
    
    %% Legend
    subgraph Legend
        L1[("Core Component")]:::core
        L2["Rule Processor"]:::rule
        L3["External System"]:::external
        L4["Error Output"]:::error
    end
```
