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

Change threshold definition in detekt #313

Closed
arturbosch opened this issue Aug 17, 2017 · 9 comments
Closed

Change threshold definition in detekt #313

arturbosch opened this issue Aug 17, 2017 · 9 comments

Comments

@arturbosch
Copy link
Member

As mentioned by @schalkms in #300 detekt's definition of a threshold is: Every value which is greater than the threshold should be flagged eg. for threshold 3:

  • value 3 will not get flagged as 3 is not > 3
  • value 4 will get flagged as 4 > 3

Other tools uses a value-inclusive-threshold: Every value which greater than or equals the threshold should get flagged eg. for threshold 3:

  • value 3 and 4 get flagged as 3|4 >= 3

Discuss and vote :)

@arturbosch
Copy link
Member Author

Leave the threshold as it is now. Every value > threshold get flagged.

@arturbosch
Copy link
Member Author

Change to every value >= threshold get flagged.

@vanniktech
Copy link
Contributor

I have no preference since even having one warning / error fails my builds. Naturally if the threshold is 3, I'd expect to only fail on 4.

If we look at the definition:

the magnitude or intensity that must be exceeded for a certain reaction, phenomenon, result, or condition to occur or be manifested.

It uses the word exceeded which would mean 3/3 okay 4/3 not.

@schalkms
Copy link
Member

schalkms commented Aug 17, 2017

>=
for me

@sschuberth
Copy link
Contributor

sschuberth commented Aug 20, 2017

For me the most natural semantics (independently of whether you call it "threshold" or something else) would be to specify "the maximum number of accepted defects". This is nice because in a project where you continuously reduce the number of defects, the current threshold would show the remaining number of defects to address. I believe this is more natural than specifying the number of defects starting from which a build is supposed to fail.

So, how about a compromise and keep the failThreshold keyword, but also introduce a maxDefects keyword, and not allow to specify both?

@arturbosch arturbosch changed the title Poll: Threshold definition in detekt Change threshold definition in detekt Feb 28, 2018
@arturbosch
Copy link
Member Author

arturbosch commented Feb 28, 2018

First: I will change the threshold definition to value >= threshold like it is used in other tools like pmd

Second: Remove warningThreshold and failThreshold and introduce maxDefects. What do you think about this? Anyone ever used this for warnings?

@vanniktech @schalkms @Mauin @sschuberth

@Mauin
Copy link
Collaborator

Mauin commented Feb 28, 2018

Sounds good. I haven't used either thresholds much so don't have a strong opinion on the warning/error thresholds overall.

arturbosch added a commit that referenced this issue Mar 4, 2018
…eshold' - #313

Use the new 'maxIssues' property instead
arturbosch added a commit that referenced this issue Mar 5, 2018
…eshold' - #313

Use the new 'maxIssues' property instead
@arturbosch
Copy link
Member Author

I think this is done for now :).

sschuberth added a commit to oss-review-toolkit/ort that referenced this issue Mar 19, 2018
This version as the UP-TO-DATE check fixed, see

detekt/detekt#725

Also, the "warningThreshold" and 'failThreshold' properties were
deprecated in favor of the new "maxIssues" property, see

detekt/detekt#313
sschuberth added a commit to oss-review-toolkit/ort that referenced this issue Mar 20, 2018
This version as the UP-TO-DATE check fixed, see

detekt/detekt#725

Also, the "warningThreshold" and "failThreshold" properties were
deprecated in favor of the new "maxIssues" property, see

detekt/detekt#313
@arturbosch arturbosch removed this from the RC13 milestone Feb 17, 2019
@lock
Copy link

lock bot commented Jun 19, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related topics.

@lock lock bot locked as resolved and limited conversation to collaborators Jun 19, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants