Count the number of lines of code changed between time periods [closed]

依然范特西╮ 提交于 2019-12-26 11:46:50

问题


For a single project, I would like to know the number of lines of code changed within a rolling time period.

We are using Jenkins and Java, and I am looking for for some kind of Jenkins plugin or report that would give me a report on demand.

The goal will be to determine if there is a relationship between bugs found and number of lines of code changed, and more importantly, to do this comparison between different projects.


回答1:


I am not sure if I understand your question correctly, but here is one idea:

  1. Write a script which will list the changes from SCM checkout and create a file. Add build step to run this script, and add its output file to artifacts of the build.

  2. Produce whatever test report as usual, and add as artifact.

  3. Trigger a downstream job, which gives these artifacts to another script, which combines them to produce your bugs/changes report.

What scripting language to use, doesn't matter as long as it has good support for the necessary file formats. If you have no preference, and know some Java, and are going to use Jenkins for a long time, then Groovy might be a good choice, because you can also write Jenkins plugins with it, or just tap into Jenkins' APIs directly. If you are not really a programmer, then Python might be a good choice. If you have a Perl expert in the project, then that might be good. And so on.



来源:https://stackoverflow.com/questions/22594604/count-the-number-of-lines-of-code-changed-between-time-periods

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