Sonarqube - Why does java generated lines of code not get populated?

余生长醉 提交于 2020-01-05 09:24:11

问题


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.

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.

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?


回答1:


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 :(.

Too bad, hopefully this will be implemented for the java ecosystem soon.



来源:https://stackoverflow.com/questions/24700102/sonarqube-why-does-java-generated-lines-of-code-not-get-populated

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!