Sonarqube-为什么不填充Java生成的代码行? [英] Sonarqube - Why does java generated lines of code not get populated?
问题描述
我正在学习在基于Maven的Java项目中使用Sonarqube 4.3.2.我的工作正常,但是无法填充生成的行"和代码的生成的行"指标.
I am learning to use Sonarqube 4.3.2 for my Maven based Java projects. I have things working pretty well, but cannot get the Generated Lines and Generated Lines of Code metrics to populate.
我希望这个指标可以跟踪供应商实际需要手工编写的代码与我们通过代码生成提供的生成代码的总数之间的多少代码.从生成的代码与手动代码中可以大致看出各种问题/统计信息,这也将有所帮助.
I would love this metric to track how much code out of the total a vendor actually has to manually code vs. generated code we provide via code generation. It would also help to see the various issues/statistics in general broken out by generated code vs. manual code.
起初,我认为Sonarqube可能会自动在 target/generated-sources 文件夹中拾取所有代码并将其标记为已生成,但这似乎没有用.
At first I thought perhaps Sonarqube would automatically pick up that any code in the target/generated-sources folder and flag it as generated, but that doesn't appear to be working.
我也曾尝试使用@javax.annotation.Generated
注释对类进行注释,但这没有任何作用.
I have also tried to annotate the classes with the @javax.annotation.Generated
annotation, but this did nothing.
我是否需要做一些特别的事情来将代码标记为正在生成?
Is there something specifically I need to do to flag code as being generated?
推荐答案
显然,生成的行和代码度量的行现在仅由COBOL插件填充,即使它们对于其他类型的项目可见/可用:(.
Apparently, the generated lines and generated lines of code metrics are only populated by the COBOL plugin right now, even though they are visible/available for other types of projects :(.
太糟糕了,希望这将很快在Java生态系统中实现.
Too bad, hopefully this will be implemented for the java ecosystem soon.
这篇关于Sonarqube-为什么不填充Java生成的代码行?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!