Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What's CPD of the Sonarqube?

Tags:

sonarqube

cpd

I works with Sonarqube every day in my job. But, I realized that I don't know what means CPD. Phrases like "INFO: CPD calculation finished", etc. I would like some help to know this.

like image 758
Vitor Rodrigues Avatar asked Aug 29 '19 20:08

Vitor Rodrigues


People also ask

What is SonarQube CPD?

Copy/paste detection? Wikipedia: CPD. A piece of code is considered duplicated as soon as there are at least 100 duplicated tokens in a row (override with sonar.cpd.${language}.minimumTokens) spread across at least 10 lines of code.

What is Sonar CPD exclusion?

sonar.cpd.exclusions. Comma-delimited list of file path patterns to be excluded from duplication detection.

How do I get the SonarQube project key?

The project key can be updated (without losing the history on the project) at Project Settings > Update Key. The new key must contain at least one non-digit character. Allowed characters are: 'a' through 'z', 'A' through 'Z', '-' (dash), '_' (underscore), '. ' (dot), ':' (colon) and digits '0' to '9'.

What is SonarQube used for?

SonarQube (formerly Sonar) is an open-source platform developed by SonarSource for continuous inspection of code quality to perform automatic reviews with static analysis of code to detect bugs, code smells on 29 programming languages.


1 Answers

Copy/paste detection?

Wikipedia: CPD

A piece of code is considered duplicated as soon as there are at least 100 duplicated tokens in a row (override with sonar.cpd.${language}.minimumTokens) spread across at least 10 lines of code

Sonarqube docs: Analysis Parameters

like image 141
mattbornski Avatar answered Sep 23 '22 12:09

mattbornski