Skip to content

sonar.cxx.metric.cpd.ignoreIdentifiers

guwirth edited this page Mar 10, 2021 · 4 revisions

The configuration parameter sonar.cxx.metric.cpd.ignoreIdentifiers is used to configure the metrics Duplications (Copy Paste Detection). The configuration can be done in the file sonar-project.properties or in the SonarQube UI under Administartion > Configuration > CXX.

sonar.cxx.metric.cpd.ignoreIdentifiers=True ignores identifier value differences when evaluating a duplicate block e.g. variable names, methods names, and so forth.

int a = 1;
int b = 1; // with 'ignoreIdentifiers=True' detected as copy from line above

The metric is displayed in the SonarQube UI under Project > Measures > Duplications.

Example:

sonar.cxx.metric.cpd.ignoreIdentifiers=False
Clone this wiki locally