ludo-technologies/pyscn
Code quality analysis for Python in the age of AI coding.
What it solves
pyscn addresses the challenge of maintaining code quality in the era of AI-assisted coding. It prevents AI-generated code from becoming unmanageable by providing structural analysis to identify dead code, duplicates, and architectural flaws that are often overlooked during rapid AI development.
How it works
Built with Go and tree-sitter, the tool performs high-speed structural analysis (processing over 100,000 lines per second) across several dimensions:
- Code Health: Detects unreachable dead code and duplicate code (clones).
- Complexity: Measures cyclomatic and cognitive complexity to find hard-to-read functions.
- Architecture: Identifies circular imports, layer rule violations (e.g., MVC or Hexagonal), and module communities.
- Class Design: Analyzes coupling (CBO) and cohesion (LCOM4).
- Hotspots: Maps per-file quality and directory complexity to prioritize refactoring.
Who it’s for
Python developers and teams using AI coding agents (like Cursor, Claude, or ChatGPT) who need to ensure their codebase remains maintainable and clean.
Highlights
- AI Agent Integration: Provides "Agent Skills" and an MCP server to allow AI agents to run health checks and refactoring reviews autonomously.
- Comprehensive Reporting: Generates a 0-100 quality score (A-F grade) and detailed HTML reports.
- CI/CD Ready: Includes a
checkcommand for fast, pass/fail quality gates in CI pipelines. - High Performance: Extremely fast execution powered by Go.
Related
- Project
- Project
- Project
- Project