Change default number of linesfor duplicated blocks

SonarQube version-6.7.7

Hi
From metric definitions i can see that for a block of code to be considered as duplicated blocks at least 10 successive statements need to be duplicated.
Is there any way to change this default number of lines at project level and global level?

Thanks
Revanth

Hi Revanth,

You’re looking for the sonar.cpd.${language}.* properties. Details in the docs.

 
HTH,
Ann

Thanks @ganncamp

@ganncamp these properties are of project/global level?

Hi,

These properties can be set as analysis parameters. There’s no where to set them in the UI.

 
Ann

Thanks @ganncamp for the Quick reply.
I need to change the default minimum no of Tokens & minimum no of Lines for duplicated blocks metric for all the languages(except java as the default values cannot be overridden) through out all the projects.
as there is no way to set them in UI what If I develop a plugin and add the properties for all languages with a default value at project/global level will that work??
or is there any other way

Thanks
Revanth

Hi Revanth,

To be honest, that’s not something that has ever come up, so I don’t know.

 
:woman_shrugging:
Ann

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.