简体   繁体   English

SonarQube CPD检测自定义插件

[英]SonarQube CPD detection on custom plugin

I have developped a custom plugin for SonarQube (C#, Powerbuilder, etc) 我已经为SonarQube开发了一个自定义插件(C#,Powerbuilder等)

The native CPD Sensor from SonarQube doesn't perform the "Cut and Paste Detection" SonarQube的本地CPD传感器不执行“剪切和粘贴检测”

Is there a special configuration for this ? 为此有特殊配置吗?

Thanks 谢谢

You have to implement the CPDMapping extension point. 您必须实现CPDMapping扩展点。 This extension point should return a Tokenizer that for a given file will return a list of tokens used by CPD algorithm. 此扩展点应返回令牌生成器,该令牌生成器对于给定的文件将返回CPD算法使用的令牌列表。

For my custom plugin, I've used NewCpdTokens . 对于我的自定义插件,我使用了NewCpdTokens It's now the preferred solution since CpdMapping is deprecated since SonarQube version 5.5. 它现在因为首选的解决方案CpdMapping是因为SonarQube 5.5版弃用。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM