qualimetrix / qualimetrix
CLI tool for static analysis of PHP code - detects architectural mess and complexity issues
v0.16.0
2026-05-01 06:34 UTC
Requires
- php: ^8.4
- amphp/parallel: ^2.0
- nikic/php-parser: ^5.0
- psr/log: ^3.0
- symfony/config: ^7.4 || ^8.0
- symfony/console: ^7.4 || ^8.0
- symfony/dependency-injection: ^7.4 || ^8.0
- symfony/expression-language: ^7.4 || ^8.0
- symfony/finder: ^7.4 || ^8.0
- symfony/yaml: ^7.4 || ^8.0
Requires (Dev)
- deptrac/deptrac: ^2.0
- friendsofphp/php-cs-fixer: ^3.0
- phpstan/phpstan: ^2.0
- phpstan/phpstan-phpunit: ^2.0
- phpstan/phpstan-strict-rules: ^2.0
- phpunit/phpunit: ^12.0
Suggests
- ext-igbinary: For faster serialization in parallel processing
- ext-parallel: For true parallel processing with threads (alternative to ext-pcntl)
- ext-pcntl: Required for parallel processing on Unix (alternative to ext-parallel)
- dev-main
- v0.16.0
- v0.15.0
- v0.14.0
- v0.13.0
- v0.12.0
- v0.11.2
- v0.11.1
- v0.11.0
- v0.10.0
- v0.9.2
- v0.9.1
- v0.9.0
- v0.8.0
- v0.7.1
- v0.7.0
- v0.6.0
- v0.5.0
- v0.4.0
- v0.3.0
- v0.2.2
- v0.2.1
- v0.2.0
- v0.1.1
- v0.1.0
- dev-claude/fix-architecture-docs-STgWc
- dev-claude/user-testing-prompts-R1mZX
- dev-claude/complete-dogfooding-features-ZvZoP
- dev-claude/add-qmx-config-Fx8xk
This package is auto-updated.
Last update: 2026-05-01 07:09:01 UTC
README
Static analysis tool for PHP code quality metrics.
Documentation | Quick Start | llms.txt
Features
- Complexity Metrics: Cyclomatic (CCN), Cognitive, NPATH
- Maintainability: Halstead metrics, Maintainability Index
- Coupling: RFC, Instability, Abstractness, Distance from Main Sequence
- Cohesion: TCC/LCC, LCOM4, WMC
- Size: LOC, Class/Method/Property Count
- Structure: DIT, NOC
- Architecture: Circular Dependency Detection
Quick Start
# Install composer require --dev qualimetrix/qualimetrix # Analyze bin/qmx check src/ # With specific format bin/qmx check src/ --format=json # Pre-commit hook bin/qmx hook:install
Output Formats
| Format | Use Case |
|---|---|
text |
CLI, human-readable |
json |
CI/CD integration |
checkstyle |
Jenkins, SonarQube |
sarif |
GitHub Security, VS Code |
gitlab |
GitLab Code Quality |
Configuration
Create qmx.yaml (full format):
rules: complexity.cyclomatic: method: warning: 15 error: 25
Or use CLI options:
bin/qmx check src/ --cyclomatic-warning=15 --cyclomatic-error=25
Git Integration
# Show violations in staged files only bin/qmx check src/ --report=git:staged # Show violations in changed files bin/qmx check src/ --report=git:main..HEAD
Baseline Support
# Generate baseline for existing violations bin/qmx check src/ --generate-baseline=baseline.json # Use baseline bin/qmx check src/ --baseline=baseline.json
Documentation
- Quick Start
- Architecture
- GitHub Action
- Changelog
- llms.txt — concise reference for AI agents
- llms-full.txt — complete documentation in a single file
Requirements
- PHP 8.4+
- Composer
Development
composer install composer test # Run tests composer phpstan # Static analysis composer check # Full validation
License
MIT