@@ -14,6 +14,16 @@ MCP-NixOS provides MCP resources and tools for NixOS packages, system options, H
1414
1515Official repository: [https://github.com/utensils/mcp-nixos](https://github.com/utensils/mcp-nixos)
1616
17+ ## Branch Management
18+
19+ - Default development branch is `develop`
20+ - Main release branch is `main`
21+ - Branch protection rules are enforced:
22+ - `main`: Requires PR review (1 approval), admin enforcement, no deletion, no force push
23+ - `develop`: Protected from deletion but allows force push
24+ - PRs follow the pattern: commit to `develop` → open PR to `main` → merge once approved
25+ - Branch deletion on merge is disabled to preserve branch history
26+
1727## Architecture
1828
1929### Core Components
@@ -122,6 +132,30 @@ Official repository: [https://github.com/utensils/mcp-nixos](https://github.com/
122132 - All tests must check for both default OS cache paths and test-specific paths
123133 - The gitignore file excludes `mcp_nixos_test_cache/` and `*test_cache*/` patterns
124134
135+ ### Code Complexity Analysis
136+ - Uses wily to track and report on code complexity metrics
137+ - Available locally via `nix develop -c complexity` command:
138+ - Build cache: `complexity build`
139+ - View report: `complexity report <file> <metric>`
140+ - Generate graph: `complexity graph <file> <metric>`
141+ - Rank files: `complexity rank [path] [metric]`
142+ - Compare changes: `complexity diff [git_ref]`
143+ - Pre-commit hook to check complexity on every commit
144+ - Continuous Integration:
145+ - Separate GitHub workflow for complexity analysis
146+ - Runs on all PRs targeting main branch
147+ - Posts complexity report as PR comment
148+ - Archives detailed reports as artifacts
149+ - Key metrics tracked:
150+ - Cyclomatic complexity
151+ - Maintainability index
152+ - Lines of code
153+ - Comments and documentation
154+ - Code complexity thresholds:
155+ - Functions should maintain cyclomatic complexity < 10
156+ - Files should maintain maintainability index > 65
157+ - Keep module sizes reasonable (< 500 lines preferred)
158+
125159### Logging Tests
126160- Prefer direct behavior verification over implementation details
127161- When testing log level filtering:
0 commit comments