added a comment - - edited
Test feedback :
In the 'Duplications' tab of the Settings page :
- The following properties should not be displayed any more in the user interface but should still be supported (so they should be added to the Advanced parameters page) :
- The following properties should be added :
- "sonar.cpd.default.engine=sonar" the other possible value is "cpd"
Moreover, there is no way from the analysis log file to know which CPD engine has been used and if the cross-project duplication detection mechanism has been activated :
[INFO] Sensor CpdSensor...
[INFO] Sensor CpdSensor done: 790 ms
As we've decided to use the word 'duplications' instead of 'clones' it would be better to rename the table 'clone_blocks' into 'duplication_index'.
The use of the 'sonar.branch' property should deactivate the detection of cross-project duplications which is not the case.
The SQL request :
SELECT hash, resource.kee, index_in_file, start_line, end_line
FROM clone_blocks AS block, snapshots AS snapshot, projects AS resource
WHERE block.snapshot_id=snapshot.id AND snapshot.islast=true
AND snapshot.project_id=resource.id AND hash IN ( SELECT hash FROM clone_blocks WHERE snapshot_id = ? )
AND block.project_snapshot_id != ?
should be replaced by :
SELECT to_blocks.hash, resource .resource.kee, to_blocks.index_in_file, to_blocks.start_line, to_blocks.end_line
FROM clone_blocks to_blocks, clone_blocks from_blocks, snapshots, projects AS resource
where to_blocks.hash = from_blocks.hash
and from_blocks.snapshot_id = ?
and to_blocks.snapshot_id = snapshots.id
and snapshots.project_id = resource.id
and to_blocks.project_snapshot_id != ?