Stelos10 Stelos10 - 2 months ago 10
Javascript Question

Sonarqube: Is it possible to adapt duplication metric for javascript code?

At the moment the duplication metric for JavaScript Code in SonarQube code is defined as followed:
“There should be at least 100 successive and duplicated tokens.
Those tokens should be spread at least on 10 lines of code.”

Is there a way to change the nummer of tokens and the number of lines? Since I want to have 5 lines.


Yes, you should put this line in your file.



A piece of code is considered as duplicated as soon as there are at least 100 successive and duplicated tokens (can be overridden with property sonar.cpd.${language}.minimumTokens) spread on at least 10 lines of code (can be overridden with property sonar.cpd.${language}.minimumLines)