Skip to content
New issue

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

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

Already on GitHub? # to your account

Allow setting separate language specific mass thresholds for identical and similar code #326

Open
rdimartino opened this issue Jul 3, 2018 · 8 comments
Assignees

Comments

@rdimartino
Copy link

I can set separate check mass thresholds with

checks:
  identical-code:
    config:
      threshold: 25
  similar-code:
    config:
      threshold: 50

but those aren't language specific.

I can set a language-specific mass threshold with

plugins:
  duplication:
    config:
      languages:
        javascript:
          mass_threshold: 50

but that sets the threshold for both identical and similar code.

I want to be able to do something like

plugins:
  duplication:
    config:
      languages:
        javascript:
          identical-code:
            mass_threshold: 25
          similar-code:
            mass_threshold: 50
@kevinleturc
Copy link

👍

@efueger
Copy link
Member

efueger commented Aug 27, 2018

Hi @kevinleturc and @rdimartino - thanks for the suggestion. Although I don't have an ETA, this is something that we're looking at adding.

Can you tell me a little bit more about your use case?

  • what languages are you using
  • if you're getting false positives for a specific language, are you using any frameworks or other standard conventions that have boilerplate similar/identical code?

@rdimartino
Copy link
Author

@efueger We're using a Rails backend with a React frontend. We were getting some false positives when using some of our more template-like React components that have a little bit more boilerplate but can't really be abstracted further.

As a work around for this we currently doing something like:

checks:
  identical-code:
    config:
      threshold: 35
...
plugins:
  duplication:
    enabled: true
    config:
      languages:
        javascript:
          mass_threshold: 75

but this is obviously not ideal.

@hiattp
Copy link

hiattp commented Jan 11, 2019

We're in the same boat, Rails backend + React frontend. In particular React has a lot of structure repetition (considered best practice afaik) like PropTypes (see #89).

@zharikovpro
Copy link

Same for us. Really want to decrease identical-code threshold only for the Javascript, as we use Ember. Works fine for the backend part on Rails.

@ygnessin
Copy link

ygnessin commented Mar 5, 2020

+1 for this. Our use-case is an android project that is partially java and partially kotlin. Thanks!

@RichStone
Copy link

+1, we have a similar situation where frontend technologies should have a different threshold than backend. Is this still being considered?

@devProdigy
Copy link

+1 it'd be very useful. We need to separate frontend from backend as well.
I wonder if there's a way to do so, maybe create separate .codeclimate.yml config files in separate folders?

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests