codeclimate/codeclimate-duplication

Allow configuration of a "number of instances" threshold

zspencer opened this issue · 4 comments

In XP, one common practice is to wait for three instances of duplication, so you don't wind up pre-maturely drying something up into a pattern that doesn't have enough instances to inform the decision

It would be nice if there was a way to configure a count threshold similar to a mass threshold so I can decide whether 2 or 3 cases is the right time to think about drying up similar code.

This engine dos support a count_threshold option, described in the README, @zspencer. That seems like it fits the functionality you're asking for. Is that not working for you?

Welp, this is what I get for assuming the online documentation is as-up-to-date as the code documentation :). Thanks for pointing that out! Closing now in pure embarrassment.

No worries, sorry the online docs you were looking at were out of date. For the record, some of the options (like count_threshod) currently covered in the README here are semi-deprecated, since we're moving away from configuring duplication under the plugins key for a variety of reasons. That's partly why the content on docs.codeclimate.com might be a bit bare right now: the docs there tend to cover more typical use cases, and more unusual/advanced usage sometimes ends up confined to the README. That said, we haven't yet implemented the new ways we want to support configuration like this with our new style of configuration yet, so we will continue to support this deprecated style of configuration for the forseeable future until we can support the same features with a new style, and then for some period of transistion time afterwards as well, of course.

Yea, I had noticed that codeclimate doesn't encourage the .yml files anymore. I'm sure you'll figure out a way to make it work awesomely :)