计算时间段之间更改的代码行数 [英] Count the number of lines of code changed between time periods

查看:89
本文介绍了计算时间段之间更改的代码行数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

对于一个项目,我想知道在滚动时间内更改的代码行数.

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

我们正在使用Jenkins和Java,并且我正在寻找某种Jenkins插件或报告,以根据需要提供报告.

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.

推荐答案

我不确定我是否正确理解了您的问题,但这是一个主意:

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

  1. 编写一个脚本,该脚本将列出SCM签出中的更改并创建一个文件.添加构建步骤以运行此脚本,并将其输出文件添加到构建的工件中.

  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.

照常生成任何测试报告,并添加为工件.

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

触发一个下游作业,将这些工件提供给另一个脚本,该脚本将它们组合在一起以生成错误/更改报告.

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

使用哪种脚本语言并不重要,只要它对必要的文件格式具有良好的支持即可.如果您没有偏好并且了解Java,并且打算长期使用Jenkins,那么Groovy可能是一个不错的选择,因为您也可以使用它编写Jenkins插件,或者直接使用Jenkins的API.如果您不是真正的程序员,那么Python可能是一个不错的选择.如果您在项目中有Perl专家,那可能很好.依此类推.

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.

这篇关于计算时间段之间更改的代码行数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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