sebastianbergmann/phpcpd

Exclude option not working properly

schmitzal opened this issue · 1 comments

With version 6 the "--exclude" option is no longer working as expected:

Command:
bin/phpcpd --exclude TCA --fuzzy packages

This should ignore every file which has "TCA" in its path. With version 5.0 this works great and I only get outputs from files without "TCA" in it's path. Using 6.0 it will also lead to messages about files in a folder called "TCA".

Output with 5.0.2:

bin/phpcpd --exclude TCA --fuzzy packages
phpcpd 5.0.2 by Sebastian Bergmann.
Found 2 clones with 79 duplicated lines in 4 files:
  - /my-project-path/packages/mypackage/Classes/Domain/Model/Entity.php:248-302 (54 lines)
    /my-project-path/packages/mypackage/Classes/Domain/Model/AnotherEntity.php:140-194
  - /my-project-path/packages/mypackage/Classes/Controller/ExampleController.php:102-127 (25 lines)
    /my-project-path/packages/mypackage/Classes/Controller/AnotherExampleController.php:77-102
1.56% duplicated lines out of 5049 total lines of code.
Average size of duplication is 39 lines, largest clone has 54 of lines
Time: 00:00.051, Memory: 6.00 MB

Output with 6.0.2 (also tested 6.0.3):

bin/phpcpd --exclude TCA --fuzzy packages
phpcpd 6.0.2 by Sebastian Bergmann.
Found 7 clones with 655 duplicated lines in 14 files:
  - /my-project-path/packages/mypackage/Configuration/TCA/some_php.php:10-93 (83 lines)
    /my-project-path/packages/mypackage/Configuration/TCA/some_more_php.php:10-93
  - /my-project-path/packages/mypackage/Configuration/TCA/even_more_php.php:26-105 (79 lines)
    [...]
  - /my-project-path/packages/mypackage/Classes/Domain/Model/Entity.php:248-302 (54 lines)
    /my-project-path/packages/mypackage/Classes/Domain/Model/AnotherEntity.php:140-194
  - /my-project-path/packages/mypackage/Configuration/TCA/some_php2.php:26-69 (43 lines)
    /my-project-path/packages/mypackage/Configuration/TCA/some_more_php2.php:26-69
    /my-project-path/packages/mypackage/Configuration/TCA/even_more_php2.php:26-69
  - /my-project-path/packages/mypackage/Classes/Controller/ExampleController.php:102-127 (25 lines)
    /my-project-path/packages/mypackage/Classes/Controller/AnotherExampleController.php:77-102
7.90% duplicated lines out of 8288 total lines of code.
Average size of duplication is 93 lines, largest clone has 83 of lines
Time: 00:00.023, Memory: 6.00 MB

Hope this description helps a bit.

Thanks and have a nice day!
Alex

Any news ?