| name | quality-analysis |
| description | Use when checking code quality, finding violations, detecting complexity issues, or running QC checks. Provides scripts for linting, naming enforcement, dead code detection, and legacy code discovery. |
Quality Analysis Tools
When to use: Before committing, when reviewing code, or when investigating quality issues.
run_qc.py
Purpose: Run all automated QC checks and generate a report.
Use when:
- Before committing changes
- After significant refactoring
- Periodic quality audits
Usage:
python scripts/run_qc.py
Runs:
- ruff check (linting)
- mypy (type checking)
- Naming convention checks
- And more
Output: Report saved to qc_reports/<timestamp>_qc_report.txt
detect_slop.py
Purpose: Find complexity hotspots, architecture violations, and refactor targets.
Use when:
- Evaluating a file's maintainability
- Finding where to focus refactoring
- Checking for AI-generated "slop" patterns
Usage:
python scripts/detect_slop.py
python scripts/detect_slop.py nomarr/interfaces/
python scripts/detect_slop.py nomarr/services/domain/tagging_svc.py
python scripts/detect_slop.py --format html
python scripts/detect_slop.py --format md
Detects:
- High cyclomatic complexity (radon)
- Architecture violations (import-linter)
- Code smells (flake8 plugins)
- Commented-out code
- Overcomplicated patterns
Decision rule: Use on one file or package at a time. Summarize findings, propose focused refactor, iterate.
check_naming.py
Purpose: Enforce Nomarr's naming conventions across the codebase.
Use when:
- Reviewing new code for naming compliance
- Finding naming violations before commit
- Verifying refactored code follows conventions
Usage:
python scripts/check_naming.py
python scripts/check_naming.py --format=json
Checks (based on scripts/configs/naming_rules.yaml):
- Service method naming (
<verb>_<noun>)
- Module naming conventions
- Forbidden patterns (
api_*, *_for_admin)
check_dead_nodes.py
Purpose: Find unreachable code (functions, classes, methods not called from entrypoints).
Use when:
- Cleaning up unused code
- After major refactoring
- Periodic maintenance
Usage:
python scripts/check_dead_nodes.py
python scripts/check_dead_nodes.py --verbose
python scripts/check_dead_nodes.py -v
python scripts/check_dead_nodes.py --format=json
Requires: Run build_code_graph.py first to generate the graph.
Output shows:
- Nodes not reachable from interface entrypoints
- Analysis of whether they're truly dead (checks imports, type usage, grep hits)
find_legacy.py
Purpose: Find references to "legacy" or "backwards compatibility" in the codebase.
Why: Nomarr is alpha. There should be NO legacy code or compatibility layers (forward-only migrations only).
Use when:
- Ensuring no one added migration/shim code
- Cleaning up TODO comments about removing old code
- Pre-release quality check
Usage:
python scripts/find_legacy.py
python scripts/find_legacy.py --format=json
python scripts/find_legacy.py nomarr/services tests/unit
Detects patterns:
legacy
backwards compatibility
deprecated
TODO...remove
FIXME...remove
Expected result: Zero matches. Any match is a violation of alpha development policy.
Workflow: Quality Check Before Commit
python scripts/run_qc.py
python scripts/find_legacy.py
python scripts/check_naming.py
python scripts/detect_slop.py nomarr/services/domain/tagging_svc.py
Workflow: Refactoring Triage
python scripts/detect_slop.py nomarr/workflows/ --format html
python scripts/detect_slop.py nomarr/workflows/processing/process_file_wf.py
python scripts/detect_slop.py nomarr/workflows/processing/process_file_wf.py
Key Rules
- Use
detect_slop.py on one file/package at a time — don't try to fix everything from one giant report
find_legacy.py should always return zero results — alpha means no legacy code (migrations are forward-only)
- Run
check_naming.py before committing — naming violations are enforcement, not cosmetic