You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
guwirth edited this page Mar 10, 2021
·
4 revisions
The configuration parameter sonar.cxx.metric.cpd.ignoreLiterals is used to configure the metricsDuplications (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.ignoreLiterals=True ignores literal (numbers, characters and strings) value differences when evaluating a duplicate block. This means that e.g. foo=42; and foo=43; will be seen as equivalent.
int a = 1;
int a = 2; // with 'ignoreLiterals=True' detected as copy from line above
The metric is displayed in the SonarQube UI under Project > Measures > Duplications.