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

CPDBear is too noisy by default for PHP #810

Closed
jayvdb opened this issue Sep 11, 2016 · 10 comments
Closed

CPDBear is too noisy by default for PHP #810

jayvdb opened this issue Sep 11, 2016 · 10 comments
Labels

Comments

@jayvdb
Copy link
Member

jayvdb commented Sep 11, 2016

When using CPDBear (from the docker image) on two PHP projects I have found many of the CPDBear results to be silly, and thus my first instinct was to disable it.

For example, this is the default output.
https://travis-ci.org/jayvdb/clipdig/builds/159077259

form/module/beritasatu/get_content.php

|   1| <?php

form/pending/gatra/get_content.php

|   1| <?php

|    | [NORMAL] CPDBear:

|    | Duplicate code found.

form/module/detik/get_content.php

|   1| <?php

form/module/sinarharapan/get_content.php

|   1| <?php

|    | [NORMAL] CPDBear:

|    | Duplicate code found.

Setting minimum_tokens = 500 in the .coafile doesnt make the problem disappear.

This might be a problem upstream in pmd.
It might be possible to make it less silly with other configuration options.
If not, it might be best to disable it for PHP until it shows meaningful results.

@gitmate-bot
Copy link
Collaborator

Thanks for reporting this issue! A coalaian will look at it soon.

@sils
Copy link
Member

sils commented Sep 11, 2016

Hi, the problem here is actually that we don't show the context of the lines due to a bug, the duplication is there and if you look into the files you'll likely see the duplication.

The bug has been fixed, I'll make a bugfix release soon including this. In the meantime you can install the bears package with --pre to get the prerelease.

@jayvdb
Copy link
Member Author

jayvdb commented Sep 11, 2016

There certainly is a lot of duplication in this codebase, so it would be lovely if it was reported sanely.

I'll try upgrading the bears in the docker; that will be useful for the documentation.

@sils
Copy link
Member

sils commented Sep 11, 2016

I'll try to get it into coala/base:0.8 today

@jayvdb
Copy link
Member Author

jayvdb commented Sep 11, 2016

Need to remove the "upstream" label on this ticket?

@sils
Copy link
Member

sils commented Sep 11, 2016

Not sure yet. If the "shwing the right source ranges in coala" solves the problem for you then this has been fixed on master and this can be closed.

@sils
Copy link
Member

sils commented Sep 11, 2016

Reopen if needed

@sils sils closed this as completed Sep 11, 2016
@jayvdb
Copy link
Member Author

jayvdb commented Sep 11, 2016

Confirmed fixed in master.

@sils
Copy link
Member

sils commented Sep 11, 2016

👍 I just did a release with the fix so you'll be able to use coala 0.8.4. I just triggered a rebuild of the docker image.

@sils
Copy link
Member

sils commented Sep 11, 2016

@jayvdb btw. we aren't fully sure about the default for the minimum tokens setting, if you have suggestions on how to change it please let us know!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

3 participants