dzunke / panaly-baseline-plugin
A Panaly plugin that deliver metrics from various quality tool baselines
Requires
- php: ^8.2
- ext-dom: *
- ext-libxml: *
- dzunke/panaly: dev-main
- phpmd/phpmd: ^2.15
- symfony/finder: ^7.0
Requires (Dev)
- doctrine/coding-standard: ^12.0
- phpstan/phpstan: ^1.10
- phpstan/phpstan-deprecation-rules: ^1.1
- phpstan/phpstan-strict-rules: ^1.5
- phpunit/phpunit: ^11.1
- symfony/var-dumper: ^7.0
This package is auto-updated.
Last update: 2025-03-13 19:10:51 UTC
README
The plugin for the Panaly Project Analyzer provides metrics for various tool baselines in the development ecosystem. When introducing new quality tools or rules, it's not always feasible to fix all errors immediately. Most tools offer a "baseline" feature to store existing errors at a specific time, which are then ignored during checks. This allows developers to fix these issues over time while ensuring new code meets quality standards, preventing new technical debt.
Available Metrics
PHPMD Baseline Count
Identifier: phpmd_baseline_count
Returns an Integer
result with the count of entries in a PHPMD baseline file, which can be filtered by subject.
Option | Description |
---|---|
baseline | (Required) The PHPMD baseline file, which must be readable and in the known PHPMD XML format. |
filter | (Optional) An array of rules to filter the baseline, e.g., StaticAccess or CyclomaticComplexity . |
PHPStan Baseline Count
Identifier: phpstan_baseline_count
Returns an Integer
result with the sum of entries in a PHPStan baseline file, summarizing the count of each entry.
Option | Description |
---|---|
baseline | (Required) The PHPStan baseline file, which must be readable and in the known PHPStan NEON format. |
paths | (Optional) Only count files for specific paths in the baseline file. A path can be anything valid in a CODEOWNERS file. |
Psalm Baseline Count
Identifier: psalm_baseline_count
Returns an Integer
result with the sum of all code
entries representing a single error within a class.
Option | Description |
---|---|
baseline | (Required) The Psalm baseline file, which must be readable and in the known Psalm XML format. |
paths | (Optional) Only count files for specific paths in the baseline file. A path can be anything valid in a CODEOWNERS file. |
Example Configuration
# panaly.dist.yaml plugins: DZunke\PanalyBaseline\BaselinePlugin: ~ # no options available groups: baselines: title: "Baseline Overview" metrics: phpmd_baseline_count: baseline: ./path/to/my/baseline.xml phpmd_baseline_count_cyclomatic: title: PHPMD Cyclomatic Complexity Baseline Count baseline: ./path/to/my/baseline.xml filter: [ 'CyclomaticComplexity' ]
Thanks and License
Panaly Project Analyzer - Baseline Plugin © 2024+, Denis Zunke. Released utilizing the MIT License.