qualimetrix/qualimetrix
最新稳定版本:v0.17.0
Composer 安装命令:
composer require qualimetrix/qualimetrix
包简介
CLI tool for static analysis of PHP code - detects architectural mess and complexity issues
关键字:
README 文档
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
统计信息
- 总下载量: 2
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 2
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: LicenseRef-Polyform-Shield-1.0.0
- 更新时间: 2026-03-25