SonarQube CPD detection on custom plugin

369 views Asked by At

I have developped a custom plugin for SonarQube (C#, Powerbuilder, etc)

The native CPD Sensor from SonarQube doesn't perform the "Cut and Paste Detection"

Is there a special configuration for this ?

Thanks

2

There are 2 answers

0
Jean-Pierre Matsumoto On

For my custom plugin, I've used NewCpdTokens. It's now the preferred solution since CpdMapping is deprecated since SonarQube version 5.5.

0
Julien H. - SonarSource Team On

You have to implement the CPDMapping extension point. This extension point should return a Tokenizer that for a given file will return a list of tokens used by CPD algorithm.