There was also a bug in the logic detecting whether the tool should be executed or not. Fixed. phpcpd execution can be controlled with the following 3 options:
- sonar.cpd.skip (true - don't run, false run)
- sonar.php.cpd.skip (true - don't run, false run)
- sonar.phpcpd.shouldRun (true - run, false don't run)
Sonar will check whether one of them has been set in configuration in the order above. If none of them is set the tool will be executed by default.
There is a typo in PhpCpdConfiguration, the option should be sonar.phpcpd.analyzeOnly not sonar.phpcpd.analyseOnly. Also the logic in PhpCpdSensor.analyse() needs changing to take into account this option and an option needs to be added to Sonar configuration panel to allow to configure it from there.