Skip to content

Commit

Permalink
pdepend - allow using coverage report for more precise stats
Browse files Browse the repository at this point in the history
Closes #124
  • Loading branch information
zdenekdrahos committed Mar 31, 2018
1 parent b3cd14e commit a6ef676
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 3 deletions.
3 changes: 3 additions & 0 deletions .phpqa.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ php-cs-fixer:
phpmd:
standard: app/phpmd.xml

pdepend:
# coverageReport: build/coverage-clover.xml

phpcpd:
minLines: 5
minTokens: 70
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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/) |
Expand Down
11 changes: 8 additions & 3 deletions src/Tools/Analyzer/Pdepend.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
1 change: 1 addition & 0 deletions tests/Config/ConfigTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit a6ef676

Please sign in to comment.