Sonarqube:是否可以适应javascript代码的重复度量? [英] Sonarqube: Is it possible to adapt duplication metric for javascript code?

查看:1181
本文介绍了Sonarqube:是否可以适应javascript代码的重复度量?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

目前SonarQube代码中JavaScript代码的重复度量值定义如下:
应至少有100个连续和重复的令牌。
这些标记应该至少在10行代码上传播。

At the moment the duplication metric for JavaScript Code in SonarQube code is defined as followed: "There should be at least 100 successive and duplicated tokens. Those tokens should be spread at least on 10 lines of code."

有没有办法更改令牌的数量和数字的线?因为我想要有5行。

Is there a way to change the nummer of tokens and the number of lines? Since I want to have 5 lines.

推荐答案

是的,你应该把这行放在你的sonar-project.properties文件中。 / p>

Yes, you should put this line in your sonar-project.properties file.

sonar.cpd.js.minimumLines=5

请参阅 http://docs.sonarqube.org/display / HOME / Duplications


一段代码被认为是重复的,一旦
最少100个连续和重复的令牌(可以用
属性sonar.cpd $ {language} .minimumTokens)覆盖至少10
行代码(可以用属性
sonar覆盖)。 cpd。$ {language} .minimumLines)

A piece of code is considered as duplicated as soon as there are at least 100 successive and duplicated tokens (can be overridden with property sonar.cpd.${language}.minimumTokens) spread on at least 10 lines of code (can be overridden with property sonar.cpd.${language}.minimumLines)

这篇关于Sonarqube:是否可以适应javascript代码的重复度量?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆