Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove the phpcpd dependency and all related functionality from code #264

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 1 addition & 7 deletions .phpqa.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ phpqa:
report: false
execution: parallel
output: file
tools: phpmetrics,phploc,phpcs,php-cs-fixer,phpmd,pdepend,phpcpd,phpstan,phpunit,psalm,security-checker,parallel-lint,deptrac
tools: phpmetrics,phploc,phpcs,php-cs-fixer,phpmd,pdepend,phpstan,phpunit,psalm,security-checker,parallel-lint,deptrac
# array definition and allowed errors count is supported too
# tools: [phploc, phpcs:0]
verbose: false
Expand Down Expand Up @@ -50,10 +50,6 @@ phpmd:
pdepend:
# coverageReport: build/coverage-clover.xml

phpcpd:
minLines: 5
minTokens: 70

phpmetrics:
# v1
config: null
Expand Down Expand Up @@ -97,7 +93,6 @@ security-checker:
# paths are relative to .phpqa.yml, so don't copy-paste this section if you don't have custom templates
report:
phploc: app/report/phploc.xsl
phpcpd: app/report/phpcpd.xsl
phpcs: app/report/phpcs.xsl
pdepend: app/report/pdepend.xsl
phpmd: app/report/phpmd.xsl
Expand Down Expand Up @@ -131,7 +126,6 @@ tool:
php-cs-fixer: Edge\QA\Tools\Analyzer\PhpCsFixer
phpmd: Edge\QA\Tools\Analyzer\Phpmd
pdepend: Edge\QA\Tools\Analyzer\Pdepend
phpcpd: Edge\QA\Tools\Analyzer\Phpcpd
parallel-lint: Edge\QA\Tools\Analyzer\ParallelLint
phpstan: Edge\QA\Tools\Analyzer\Phpstan
phpunit: Edge\QA\Tools\Analyzer\Phpunit
Expand Down
25 changes: 4 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ Will you create e.g. Jenkins project/task for each bundle?
Tool| Description
----------------------------------------------------------------------- | ----------------------------- |
[phploc](https://github.com/sebastianbergmann/phploc) | Measure the size of a PHP project |
[phpcpd](https://github.com/sebastianbergmann/phpcpd) | Copy/Paste Detector (CPD) for PHP code |
[phpcs](https://github.com/squizlabs/PHP_CodeSniffer) | Detect violations of a coding standard |
[pdepend](https://github.com/pdepend/pdepend) | PHP adaptation of JDepend |
[phpmd](https://github.com/phpmd/phpmd) | Scan PHP project for messy code |
Expand Down Expand Up @@ -91,20 +90,6 @@ But I wouldn't recommend it. In my experience *one* QA tool which analyzes
*N* projects is better than *N* projects with *N* analyzers. It's up to you
how many repositories you want to update when new version is released.

##### Symfony3 components

Symfony3 is supported since [version 1.7](/CHANGELOG.md#v170).
Install at least version `~3.0` of `sebastian/phpcpd`, otherwise you'll get error [`The helper "progress" is not defined.`](https://github.com/EdgedesignCZ/phpqa/issues/19)

```json
{
"require-dev": {
"edgedesign/phpqa": ">=1.7",
"sebastian/phpcpd": "~3.0"
}
}
```

##### Fake global installation in local project

Do you have problems with dependencies and you can't install phpqa globally?
Expand Down Expand Up @@ -168,7 +153,7 @@ docker run --rm -u $UID -v $PWD:/app eko3alpha/docker-phpqa --report --ignoredDi
| `phpqa --ignoredDirs build,vendor` | Ignore directories |
| `phpqa --ignoredFiles RoboFile.php` | Ignore files |
| `phpqa --tools phploc,phpcs` | Run only selected tools |
| `phpqa --tools phpmd:1,phpcs:0,phpcpd:0` | Check number of errors and [exit code](#exit-code). **New in v1.6** |
| `phpqa --tools phpmd:1,phpcs:0` | Check number of errors and [exit code](#exit-code). **New in v1.6** |
| `phpqa --verbose` | Show output from executed tools |
| `phpqa --quiet` | Show no output at all |
| `phpqa --output cli` | [CLI output](#output-modes) instead of creating files in `--buildDir` |
Expand All @@ -185,7 +170,6 @@ _Tip:_ CLI options can be defined in [.phpqa.yml](#advanced-configuration---phpq
Tool | `--output file` (default) - generated files | `--output cli` |
---- | ------------------------- | -------------- |
phploc | [phploc.xml](https://edgedesigncz.github.io/phpqa/report/phploc.xml) | [✓](https://github.com/sebastianbergmann/phploc#analyse-a-directory-and-print-the-result) |
phpcpd | [phpcpd.xml](https://edgedesigncz.github.io/phpqa/report/phpcpd.xml) | [✓](https://github.com/sebastianbergmann/phpcpd#usage-example) |
phpcs | [checkstyle.xml](https://edgedesigncz.github.io/phpqa/report/checkstyle.xml) | [full report](https://github.com/squizlabs/PHP_CodeSniffer/wiki/Reporting#printing-full-and-summary-reports) |
pdepend | [pdepend-jdepend.xml](https://edgedesigncz.github.io/phpqa/report/pdepend-jdepend.xml), [pdepend-summary.xml](https://edgedesigncz.github.io/phpqa/report/pdepend-summary.xml), [pdepend-dependencies.xml](https://edgedesigncz.github.io/phpqa/report/pdepend-dependencies.xml), [pdepend-jdepend.svg](https://edgedesigncz.github.io/phpqa/report/pdepend-jdepend.svg), [pdepend-pyramid.svg](https://edgedesigncz.github.io/phpqa/report/pdepend-pyramid.svg) | ✗ |
phpmd | [phpmd.xml](https://edgedesigncz.github.io/phpqa/report/phpmd.xml) | [✓](https://github.com/phpmd/phpmd/blob/master/src/main/php/PHPMD/Renderer/TextRenderer.php#L47) |
Expand All @@ -199,7 +183,7 @@ deptrac | [deptrac.html](https://edgedesigncz.github.io/phpqa/report/deptrac.htm
## Exit code

`phpqa` can return non-zero exit code **since version 1.6**. It's optional feature that is by default turned off.
You have to define number of allowed errors for *phpcpd, phpcs, phpmd* in `--tools`.
You have to define number of allowed errors for *phpcs, phpmd* in `--tools`.

[mode](#output-modes) | Supported version | What is analyzed? |
--------------------- | ----------------- | ----------------- |
Expand All @@ -211,7 +195,7 @@ or [Circle CI](https://circleci.com/docs/manually/#overview) build should fail w
Define number of allowed errors for each tools and watch the build:

```bash
phpqa --report --tools phpcs:0,phpmd:0,phpcpd:0,parallel-lint:0,phpstan:0,phpmetrics,phploc,pdepend
phpqa --report --tools phpcs:0,phpmd:0,parallel-lint:0,phpstan:0,phpmetrics,phploc,pdepend
```

Number of allowed errors can be also defined in [.phpqa.yml](#advanced-configuration---phpqayml).
Expand Down Expand Up @@ -331,7 +315,6 @@ Tool | Settings | Default Value | Your value
[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.standard](http://phpmd.org/documentation/creating-a-ruleset.html) | Ruleset | [Edgedesign's standard](/app/phpmd.xml) | Path to ruleset. To specify [multiple rule sets](https://phpmd.org/documentation/index.html#using-multiple-rule-sets), you can use an array
[phpmd.ignoreParsingErrors](https://github.com/EdgedesignCZ/phpqa/issues/230) | If parsing errors affect exit code, or just violations | `true` | Boolean value
[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, memory limit | Level 0, `%currentWorkingDirectory%/phpstan.neon`, memoryLimit: null | Take a look at [phpqa config in tests/.ci](/tests/.ci/) |
[phpunit.binary](https://github.com/EdgedesignCZ/phpqa/blob/4947416/.phpqa.yml#L40) | Phpunit binary | phpqa's phpunit | Path to phpunit executable in your project, typically [`vendor/bin/phpunit`](https://gitlab.com/costlocker/integrations/blob/master/basecamp/backend/.phpqa.yml#L2) |
[phpunit.config](https://phpunit.de/manual/current/en/organizing-tests.html#organizing-tests.xml-configuration) | PHPUnit configuration, `analyzedDirs` and `ignoredDirs` are not used, you have to specify test suites in XML file | `null` | Path to `phpunit.xml` file
Expand Down Expand Up @@ -477,7 +460,7 @@ dependencies:
test:
override:
- vendor/bin/phpunit --testdox-html ./var/tests/testdox.html --testdox-text ./var/tests/testdox.txt --log-junit $CIRCLE_TEST_REPORTS/phpunit/junit.xml
- qa/phpqa --report --verbose --buildDir var/QA --ignoredDirs vendor --tools=phpcs:0,phpmd:0,phpcpd:0,phploc,pdepend,phpmetrics
- qa/phpqa --report --verbose --buildDir var/QA --ignoredDirs vendor --tools=phpcs:0,phpmd:0,phploc,pdepend,phpmetrics
post:
- cp -r ./var/QA $CIRCLE_ARTIFACTS
- cp -r ./var/tests $CIRCLE_ARTIFACTS
Expand Down
5 changes: 0 additions & 5 deletions app/report/phpqa.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,6 @@ set tabs = {
'errors': 'Errors',
'parsing': 'Parsing Errors',
},
'phpcpd': {
'overview': 'Overview',
'errors': 'Errors',
},
'phploc': {
'overview': 'Overview',
'ccn': 'Cyclomatic Complexity',
Expand Down Expand Up @@ -271,7 +267,6 @@ set tabs = {
'#pdepend': openBootstrap,
'#phpcs': openBootstrap,
'#phpmd': openBootstrap,
'#phpcpd': openBootstrap,
'#phploc': openBootstrap,
'#phpmetrics': function(window, tab, iframe) {
{% if phpmetricsVersion == 1 %}
Expand Down
1 change: 0 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
"symfony/yaml": ">=2.8",
"twig/twig": "~1.38|~2.7|~3",
"pdepend/pdepend": "*",
"sebastian/phpcpd": "*",
"squizlabs/php_codesniffer": "*",
"phpmetrics/phpmetrics": "*"
},
Expand Down
3 changes: 1 addition & 2 deletions src/CodeAnalysisTasks.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,21 @@
trait CodeAnalysisTasks
{
/** @var Tools */
private $tools;

Check warning on line 10 in src/CodeAnalysisTasks.php

View workflow job for this annotation

GitHub Actions / phpqa (8, yes)

MissingConstructor

src/CodeAnalysisTasks.php:10:13: MissingConstructor: Edge\QA\RoboFile has an uninitialized property Edge\QA\CodeAnalysisTasks::$tools, but no constructor (see https://psalm.dev/073)

Check warning on line 10 in src/CodeAnalysisTasks.php

View workflow job for this annotation

GitHub Actions / phpqa (8.2, yes)

MissingConstructor

src/CodeAnalysisTasks.php:10:13: MissingConstructor: Edge\QA\RoboFile has an uninitialized property Edge\QA\CodeAnalysisTasks::$tools, but no constructor (see https://psalm.dev/073)

Check warning on line 10 in src/CodeAnalysisTasks.php

View workflow job for this annotation

GitHub Actions / phpqa (8.1, yes)

MissingConstructor

src/CodeAnalysisTasks.php:10:13: MissingConstructor: Edge\QA\RoboFile has an uninitialized property Edge\QA\CodeAnalysisTasks::$tools, but no constructor (see https://psalm.dev/073)

Check warning on line 10 in src/CodeAnalysisTasks.php

View workflow job for this annotation

GitHub Actions / phpqa (7.4, yes)

MissingConstructor

src/CodeAnalysisTasks.php:10:13: MissingConstructor: Edge\QA\RoboFile has an uninitialized property Edge\QA\CodeAnalysisTasks::$tools, but no constructor (see https://psalm.dev/073)
/** @var Options */
private $options;

Check warning on line 12 in src/CodeAnalysisTasks.php

View workflow job for this annotation

GitHub Actions / phpqa (8, yes)

MissingConstructor

src/CodeAnalysisTasks.php:12:13: MissingConstructor: Edge\QA\RoboFile has an uninitialized property Edge\QA\CodeAnalysisTasks::$options, but no constructor (see https://psalm.dev/073)

Check warning on line 12 in src/CodeAnalysisTasks.php

View workflow job for this annotation

GitHub Actions / phpqa (8.2, yes)

MissingConstructor

src/CodeAnalysisTasks.php:12:13: MissingConstructor: Edge\QA\RoboFile has an uninitialized property Edge\QA\CodeAnalysisTasks::$options, but no constructor (see https://psalm.dev/073)

Check warning on line 12 in src/CodeAnalysisTasks.php

View workflow job for this annotation

GitHub Actions / phpqa (8.1, yes)

MissingConstructor

src/CodeAnalysisTasks.php:12:13: MissingConstructor: Edge\QA\RoboFile has an uninitialized property Edge\QA\CodeAnalysisTasks::$options, but no constructor (see https://psalm.dev/073)

Check warning on line 12 in src/CodeAnalysisTasks.php

View workflow job for this annotation

GitHub Actions / phpqa (7.4, yes)

MissingConstructor

src/CodeAnalysisTasks.php:12:13: MissingConstructor: Edge\QA\RoboFile has an uninitialized property Edge\QA\CodeAnalysisTasks::$options, but no constructor (see https://psalm.dev/073)

/**
* @description Current versions
* @option $config path directory with .phpqa.yml, <comment>@default</comment> <info>current working directory</info>
*/
public function tools(

Check warning on line 18 in src/CodeAnalysisTasks.php

View workflow job for this annotation

GitHub Actions / phpqa (8, yes)

MissingReturnType

src/CodeAnalysisTasks.php:18:21: MissingReturnType: Method Edge\QA\CodeAnalysisTasks::tools does not have a return type, expecting void (see https://psalm.dev/050)

Check warning on line 18 in src/CodeAnalysisTasks.php

View workflow job for this annotation

GitHub Actions / phpqa (8.2, yes)

MissingReturnType

src/CodeAnalysisTasks.php:18:21: MissingReturnType: Method Edge\QA\CodeAnalysisTasks::tools does not have a return type, expecting void (see https://psalm.dev/050)

Check warning on line 18 in src/CodeAnalysisTasks.php

View workflow job for this annotation

GitHub Actions / phpqa (8.1, yes)

MissingReturnType

src/CodeAnalysisTasks.php:18:21: MissingReturnType: Method Edge\QA\CodeAnalysisTasks::tools does not have a return type, expecting void (see https://psalm.dev/050)

Check warning on line 18 in src/CodeAnalysisTasks.php

View workflow job for this annotation

GitHub Actions / phpqa (7.4, yes)

MissingReturnType

src/CodeAnalysisTasks.php:18:21: MissingReturnType: Method Edge\QA\CodeAnalysisTasks::tools does not have a return type, expecting void (see https://psalm.dev/050)
$opts = [

Check warning on line 19 in src/CodeAnalysisTasks.php

View workflow job for this annotation

GitHub Actions / phpqa (8, yes)

MissingParamType

src/CodeAnalysisTasks.php:19:9: MissingParamType: Parameter $opts has no provided type (see https://psalm.dev/154)

Check warning on line 19 in src/CodeAnalysisTasks.php

View workflow job for this annotation

GitHub Actions / phpqa (8.2, yes)

MissingParamType

src/CodeAnalysisTasks.php:19:9: MissingParamType: Parameter $opts has no provided type (see https://psalm.dev/154)

Check warning on line 19 in src/CodeAnalysisTasks.php

View workflow job for this annotation

GitHub Actions / phpqa (8.1, yes)

MissingParamType

src/CodeAnalysisTasks.php:19:9: MissingParamType: Parameter $opts has no provided type (see https://psalm.dev/154)

Check warning on line 19 in src/CodeAnalysisTasks.php

View workflow job for this annotation

GitHub Actions / phpqa (7.4, yes)

MissingParamType

src/CodeAnalysisTasks.php:19:9: MissingParamType: Parameter $opts has no provided type (see https://psalm.dev/154)
'config' => null,
]
) {
$this->loadConfig($opts);
$versions = new Task\TableVersions($this->getOutput());

Check warning on line 24 in src/CodeAnalysisTasks.php

View workflow job for this annotation

GitHub Actions / phpqa (8, yes)

DeprecatedMethod

src/CodeAnalysisTasks.php:24:51: DeprecatedMethod: The method Robo\Common\OutputAwareTrait::getOutput has been marked as deprecated (see https://psalm.dev/001)

Check warning on line 24 in src/CodeAnalysisTasks.php

View workflow job for this annotation

GitHub Actions / phpqa (8.2, yes)

DeprecatedMethod

src/CodeAnalysisTasks.php:24:51: DeprecatedMethod: The method Robo\Common\OutputAwareTrait::getOutput has been marked as deprecated (see https://psalm.dev/001)

Check warning on line 24 in src/CodeAnalysisTasks.php

View workflow job for this annotation

GitHub Actions / phpqa (8.1, yes)

DeprecatedMethod

src/CodeAnalysisTasks.php:24:51: DeprecatedMethod: The method Robo\Common\OutputAwareTrait::getOutput has been marked as deprecated (see https://psalm.dev/001)

Check warning on line 24 in src/CodeAnalysisTasks.php

View workflow job for this annotation

GitHub Actions / phpqa (7.4, yes)

DeprecatedMethod

src/CodeAnalysisTasks.php:24:51: DeprecatedMethod: The method Robo\Common\OutputAwareTrait::getOutput has been marked as deprecated (see https://psalm.dev/001)
$versions($this->tools->getVersions());
}

Expand All @@ -32,14 +32,14 @@
* @option $buildDir path to output directory <comment>@default</comment> <info>build/</info>
* @option $ignoredDirs csv <comment>@default</comment> <info>vendor</info> <comment>@example</comment> CI,bin,vendor
* @option $ignoredFiles csv <comment>@example</comment> RoboFile.php
* @option $tools csv with optional definition of allowed errors count <comment>@default</comment> <info>phpmetrics,phploc,phpcs,php-cs-fixer,phpmd,pdepend,phpcpd,phpstan,phpunit,psalm,security-checker,parallel-lint</info> <comment>@example</comment> phploc,phpmd:1,phpcs:0
* @option $tools csv with optional definition of allowed errors count <comment>@default</comment> <info>phpmetrics,phploc,phpcs,php-cs-fixer,phpmd,pdepend,phpstan,phpunit,psalm,security-checker,parallel-lint</info> <comment>@example</comment> phploc,phpmd:1,phpcs:0
* @option $output output format <comment>@default</comment> <info>file</info> <comment>@example</comment> cli
* @option $execution output format <comment>@default</comment> <info>parallel</info> <comment>@example</comment> no-parallel
* @option $config path directory with .phpqa.yml, <comment>@default</comment> <info>current working directory</info>
* @option $report build HTML report (only when output format is file), 'offline' for bundling assets with report <comment>@example</comment> offline
*/
public function ci(

Check warning on line 41 in src/CodeAnalysisTasks.php

View workflow job for this annotation

GitHub Actions / phpqa (8, yes)

MissingReturnType

src/CodeAnalysisTasks.php:41:21: MissingReturnType: Method Edge\QA\CodeAnalysisTasks::ci does not have a return type (see https://psalm.dev/050)

Check warning on line 41 in src/CodeAnalysisTasks.php

View workflow job for this annotation

GitHub Actions / phpqa (8.2, yes)

MissingReturnType

src/CodeAnalysisTasks.php:41:21: MissingReturnType: Method Edge\QA\CodeAnalysisTasks::ci does not have a return type (see https://psalm.dev/050)

Check warning on line 41 in src/CodeAnalysisTasks.php

View workflow job for this annotation

GitHub Actions / phpqa (8.1, yes)

MissingReturnType

src/CodeAnalysisTasks.php:41:21: MissingReturnType: Method Edge\QA\CodeAnalysisTasks::ci does not have a return type (see https://psalm.dev/050)

Check warning on line 41 in src/CodeAnalysisTasks.php

View workflow job for this annotation

GitHub Actions / phpqa (7.4, yes)

MissingReturnType

src/CodeAnalysisTasks.php:41:21: MissingReturnType: Method Edge\QA\CodeAnalysisTasks::ci does not have a return type (see https://psalm.dev/050)
$opts = [

Check warning on line 42 in src/CodeAnalysisTasks.php

View workflow job for this annotation

GitHub Actions / phpqa (8, yes)

MissingParamType

src/CodeAnalysisTasks.php:42:9: MissingParamType: Parameter $opts has no provided type (see https://psalm.dev/154)

Check warning on line 42 in src/CodeAnalysisTasks.php

View workflow job for this annotation

GitHub Actions / phpqa (8.2, yes)

MissingParamType

src/CodeAnalysisTasks.php:42:9: MissingParamType: Parameter $opts has no provided type (see https://psalm.dev/154)

Check warning on line 42 in src/CodeAnalysisTasks.php

View workflow job for this annotation

GitHub Actions / phpqa (8.1, yes)

MissingParamType

src/CodeAnalysisTasks.php:42:9: MissingParamType: Parameter $opts has no provided type (see https://psalm.dev/154)

Check warning on line 42 in src/CodeAnalysisTasks.php

View workflow job for this annotation

GitHub Actions / phpqa (7.4, yes)

MissingParamType

src/CodeAnalysisTasks.php:42:9: MissingParamType: Parameter $opts has no provided type (see https://psalm.dev/154)
'analyzedDir' => null,
'analyzedDirs' => null,
'buildDir' => null,
Expand All @@ -62,7 +62,7 @@
return $this->buildSummary();
}

private function normalizeCliOptions(array $options)

Check warning on line 65 in src/CodeAnalysisTasks.php

View workflow job for this annotation

GitHub Actions / phpqa (8, yes)

MissingReturnType

src/CodeAnalysisTasks.php:65:22: MissingReturnType: Method Edge\QA\CodeAnalysisTasks::normalizeCliOptions does not have a return type, expecting array{report: bool|non-empty-mixed, ...<array-key, mixed>} (see https://psalm.dev/050)

Check warning on line 65 in src/CodeAnalysisTasks.php

View workflow job for this annotation

GitHub Actions / phpqa (8.2, yes)

MissingReturnType

src/CodeAnalysisTasks.php:65:22: MissingReturnType: Method Edge\QA\CodeAnalysisTasks::normalizeCliOptions does not have a return type, expecting array{report: bool|non-empty-mixed, ...<array-key, mixed>} (see https://psalm.dev/050)

Check warning on line 65 in src/CodeAnalysisTasks.php

View workflow job for this annotation

GitHub Actions / phpqa (8.1, yes)

MissingReturnType

src/CodeAnalysisTasks.php:65:22: MissingReturnType: Method Edge\QA\CodeAnalysisTasks::normalizeCliOptions does not have a return type, expecting array{report: bool|non-empty-mixed, ...<array-key, mixed>} (see https://psalm.dev/050)

Check warning on line 65 in src/CodeAnalysisTasks.php

View workflow job for this annotation

GitHub Actions / phpqa (7.4, yes)

MissingReturnType

src/CodeAnalysisTasks.php:65:22: MissingReturnType: Method Edge\QA\CodeAnalysisTasks::normalizeCliOptions does not have a return type, expecting array{report: bool|non-empty-mixed, ...<array-key, mixed>} (see https://psalm.dev/050)
{
if (!$options['analyzedDirs'] && $options['analyzedDir']) {
$options['analyzedDirs'] = $options['analyzedDir'];
Expand Down Expand Up @@ -95,7 +95,6 @@
'php-cs-fixer',
'phpmd',
'pdepend',
'phpcpd',
'phpstan',
'phpunit',
'psalm',
Expand All @@ -114,7 +113,7 @@
];
$options = [];
foreach ($availableOptions as $option => $defaultValue) {
if ($cliOptions[$option]) {

Check failure on line 116 in src/CodeAnalysisTasks.php

View workflow job for this annotation

GitHub Actions / phpqa (8, yes)

PossiblyUndefinedArrayOffset

src/CodeAnalysisTasks.php:116:17: PossiblyUndefinedArrayOffset: Possibly undefined array key $cliOptions[$option] on array{analyzedDirs?: mixed, buildDir?: mixed, execution?: mixed, ignoredDirs?: mixed, ignoredFiles?: mixed, output?: mixed, report?: mixed, tools?: mixed, verbose?: mixed, ...<array-key, mixed>} (see https://psalm.dev/167)

Check failure on line 116 in src/CodeAnalysisTasks.php

View workflow job for this annotation

GitHub Actions / phpqa (8.2, yes)

PossiblyUndefinedArrayOffset

src/CodeAnalysisTasks.php:116:17: PossiblyUndefinedArrayOffset: Possibly undefined array key $cliOptions[$option] on array{analyzedDirs?: mixed, buildDir?: mixed, execution?: mixed, ignoredDirs?: mixed, ignoredFiles?: mixed, output?: mixed, report?: mixed, tools?: mixed, verbose?: mixed, ...<array-key, mixed>} (see https://psalm.dev/167)

Check failure on line 116 in src/CodeAnalysisTasks.php

View workflow job for this annotation

GitHub Actions / phpqa (8.1, yes)

PossiblyUndefinedArrayOffset

src/CodeAnalysisTasks.php:116:17: PossiblyUndefinedArrayOffset: Possibly undefined array key $cliOptions[$option] on array{analyzedDirs?: mixed, buildDir?: mixed, execution?: mixed, ignoredDirs?: mixed, ignoredFiles?: mixed, output?: mixed, report?: mixed, tools?: mixed, verbose?: mixed, ...<array-key, mixed>} (see https://psalm.dev/167)

Check failure on line 116 in src/CodeAnalysisTasks.php

View workflow job for this annotation

GitHub Actions / phpqa (7.4, yes)

PossiblyUndefinedArrayOffset

src/CodeAnalysisTasks.php:116:17: PossiblyUndefinedArrayOffset: Possibly undefined array key $cliOptions[$option] on array{analyzedDirs?: mixed, buildDir?: mixed, execution?: mixed, ignoredDirs?: mixed, ignoredFiles?: mixed, output?: mixed, report?: mixed, tools?: mixed, verbose?: mixed, ...<array-key, mixed>} (see https://psalm.dev/167)
$options[$option] = $cliOptions[$option];
} else {
$options[$option] = $config->value("phpqa.{$option}") ?: $defaultValue;
Expand Down
46 changes: 0 additions & 46 deletions src/Tools/Analyzer/Phpcpd.php

This file was deleted.

2 changes: 1 addition & 1 deletion tests/.appveyor/.phpqa.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
phpqa:
tools: phpmetrics,phploc,phpcs:0,php-cs-fixer,phpmd:0,pdepend,phpcpd:0,phpstan,phpunit:0,psalm,security-checker,parallel-lint
tools: phpmetrics,phploc,phpcs:0,php-cs-fixer,phpmd:0,pdepend,phpstan,phpunit:0,psalm,security-checker,parallel-lint
ignoredFiles: tests/.phpunit/fix-psalm-testcase.php

phpmd:
Expand Down
1 change: 0 additions & 1 deletion tests/.ci/.phpqa.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ phpqa:
- php-cs-fixer
- phpmd:0
- pdepend
- phpcpd
- phpstan
- phpunit:0
- psalm
Expand Down
3 changes: 0 additions & 3 deletions tests/Config/.phpqa.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,6 @@ phpcs:
phpmd:
standard: my-standard.xml

# should ignore empty values
phpcpd:

# invalid binary
phpunit:
binary: non-existent-binary
Expand Down
7 changes: 1 addition & 6 deletions tests/Config/ConfigTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,11 @@
/** @SuppressWarnings(PHPMD.TooManyPublicMethods) */
class ConfigTest extends \PHPUnit_Framework_TestCase
{
private $defaultToolsCount = 13;
private $defaultToolsCount = 12;

public function testLoadDefaultConfig()
{
$config = new Config();
assertThat($config->value('phpcpd.minLines'), is(greaterThan(0)));
assertThat($config->value('phpcpd.minTokens'), is(greaterThan(0)));
assertThat($config->value('phpcs.standard'), is(nonEmptyString()));
assertThat($config->value('phpcs.ignoreWarnings'), identicalTo(false));
assertThat($config->value('phpcs.reports.cli'), is(nonEmptyArray()));
Expand Down Expand Up @@ -51,8 +49,6 @@ public function testOverrideDefaultConfig()
{
$config = new Config();
$config->loadUserConfig(__DIR__);
assertThat($config->value('phpcpd.minLines'), is(5));
assertThat($config->value('phpcpd.minTokens'), is(70));
assertThat($config->value('phpcs.standard'), is('Zend'));
assertThat($config->path('phpmd.standard'), is(__DIR__ . DIRECTORY_SEPARATOR . 'my-standard.xml'));
}
Expand Down Expand Up @@ -125,7 +121,6 @@ public function testMultipleConfig()

assertThat($config->value('phpcs.standard'), is('PSR2'));
assertThat($config->value('phpmd.standard'), is('my-standard.xml'));
assertThat($config->value('phpcpd.lines'), is(53));
assertThat($config->csv('phpqa.extensions'), is('php,inc'));
}

Expand Down
4 changes: 0 additions & 4 deletions tests/Config/sub-config/.phpqa.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@
phpcs:
standard: PSR2

# should override default standard
phpcpd:
lines: 53

# Php file extensions to parse.
extensions:
- php
Expand Down
2 changes: 1 addition & 1 deletion tests/OptionsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class OptionsTest extends \PHPUnit_Framework_TestCase
'buildDir' => 'build/',
'ignoredDirs' => 'vendor',
'ignoredFiles' => '',
'tools' => 'phploc,phpcpd,phpcs,pdepend,phpmd,phpmetrics',
'tools' => 'phploc,phpcs,pdepend,phpmd,phpmetrics',
'output' => 'file',
'config' => '',
'verbose' => true,
Expand Down
Loading