diff --git a/.phpqa.yml b/.phpqa.yml index cf1fb6d2..ac322d4a 100644 --- a/.phpqa.yml +++ b/.phpqa.yml @@ -24,6 +24,9 @@ php-cs-fixer: phpmd: standard: app/phpmd.xml +pdepend: + # coverageReport: build/coverage-clover.xml + phpcpd: minLines: 5 minTokens: 70 diff --git a/README.md b/README.md index 2dcd2d3e..2bcab52b 100644 --- a/README.md +++ b/README.md @@ -229,6 +229,7 @@ Tool | Settings | Default Value | Your value [phpmetrics.git](https://github.com/EdgedesignCZ/phpqa/pull/122) | phpmetrics v2 analyses based on Git History | `null` | Boolean value or path to git binary [phpmetrics.junit](https://github.com/EdgedesignCZ/phpqa/pull/125) | phpmetrics v2 evaluates metrics according to JUnit logs | `null` | Path to JUnit xml [phpmetrics.composer](https://github.com/EdgedesignCZ/phpqa/pull/123) | phpmetrics v2 analyzes composer dependencies | `null` | Path to composer.json when the file is not included in `analyzedDirs` +[pdepend.coverageReport](https://github.com/EdgedesignCZ/phpqa/pull/124) | Load Clover style CodeCoverage report | `null` | Path to report produced by PHPUnit's `--coverage-clover` option [phpmd](http://phpmd.org/documentation/creating-a-ruleset.html) | Ruleset | [Edgedesign's standard](/app/phpmd.xml) | Path to ruleset [phpcpd](https://github.com/sebastianbergmann/phpcpd/blob/de9056615da6c1230f3294384055fa7d722c38fa/src/CLI/Command.php#L136) | Minimum number of lines/tokens for copy-paste detection | 5 lines, 70 tokens | [phpstan](https://github.com/phpstan/phpstan#configuration) | Level, config file | Level 0, `%currentWorkingDirectory%/phpstan.neon` | Take a look at [phpqa config in tests/.travis](/tests/.travis/) | diff --git a/src/Tools/Analyzer/Pdepend.php b/src/Tools/Analyzer/Pdepend.php index 31c516f4..63e75a7c 100644 --- a/src/Tools/Analyzer/Pdepend.php +++ b/src/Tools/Analyzer/Pdepend.php @@ -12,15 +12,20 @@ class Pdepend extends \Edge\QA\Tools\Tool public function __invoke() { - return array( + $args = array( 'jdepend-xml' => $this->options->toFile('pdepend-jdepend.xml'), 'summary-xml' => $this->options->toFile('pdepend-summary.xml'), 'dependency-xml' => $this->options->toFile('pdepend-dependencies.xml'), 'jdepend-chart' => $this->options->toFile('pdepend-jdepend.svg'), 'overview-pyramid' => $this->options->toFile('pdepend-pyramid.svg'), 'suffix' => $this->config->csv('extensions'), - $this->options->ignore->pdepend(), - $this->options->getAnalyzedDirs(',') + $this->options->ignore->pdepend() ); + $coverageReport = $this->config->value('pdepend.coverageReport'); + if ($coverageReport) { + $args['coverage-report'] = $coverageReport; + } + $args[] = $this->options->getAnalyzedDirs(','); + return $args; } } diff --git a/tests/Config/ConfigTest.php b/tests/Config/ConfigTest.php index 7c34c61c..28cdc51f 100644 --- a/tests/Config/ConfigTest.php +++ b/tests/Config/ConfigTest.php @@ -33,6 +33,7 @@ public function testLoadDefaultConfig() assertThat($config->value('phpmetrics.junit'), is(nullValue())); assertThat($config->value('phpmetrics.composer'), is(nullValue())); assertThat($config->value('phpmetrics.git'), identicalTo(false)); + assertThat($config->value('pdepend.coverageReport'), is(nullValue())); } public function testBuildAbsolutePath()