Search in sources :

Example 1 with PmdBlockChunker

use of org.sonar.duplications.internal.pmd.PmdBlockChunker in project sonarqube by SonarSource.

the class DefaultSensorStorage method store.

@Override
public void store(DefaultCpdTokens defaultCpdTokens) {
    DefaultInputFile inputFile = (DefaultInputFile) defaultCpdTokens.inputFile();
    inputFile.setPublish(true);
    PmdBlockChunker blockChunker = new PmdBlockChunker(getBlockSize(inputFile.language()));
    List<Block> blocks = blockChunker.chunk(inputFile.key(), defaultCpdTokens.getTokenLines());
    index.insert(inputFile, blocks);
}
Also used : DefaultInputFile(org.sonar.api.batch.fs.internal.DefaultInputFile) PmdBlockChunker(org.sonar.duplications.internal.pmd.PmdBlockChunker) Block(org.sonar.duplications.block.Block)

Aggregations

DefaultInputFile (org.sonar.api.batch.fs.internal.DefaultInputFile)1 Block (org.sonar.duplications.block.Block)1 PmdBlockChunker (org.sonar.duplications.internal.pmd.PmdBlockChunker)1