Reuse Sonar Checkstyle Violation Report for Custom Data Analysis
Write a violation rules file;
Import it into Sonar as a Quality Profile named as "MyRules";
Add the following properties to ant script:
Run Ant script, and you can get the report at $PROJECT_HOME/.sonar/checkstyle-result.xml;
Use the following python script to extract data from the report:
from xml.etree import ElementTree as ET
tree = ET.parse('/path/to/checkstyle-result.xml')
root = tree.getroot()
cycleCnt = 0
nestCnt = 0
for error in root.iter('error'):
msg = error.get('message')
if msg.startswith('Cyclomatic'):
cycleCnt += 1
if msg.startswith('Nested'):
nestCnt += 1
print "Cyclomatic:",cycleCnt,"Nested:",nestCnt
See "Section 19.7: xml.etree.ElementTree" of documentation of Python 2.7.5 for details.
Reuse Sonar Checkstyle Violation Report for Custom Data Analysis的更多相关文章
- Custom Data Service Providers
Custom Data Service Providers Introduction Data Services sits above a Data Service Provider, which i ...
- [TypeScript] Custom data structures in TypeScript with iterators
We usually think of types as something that can define a single layer of an object: with an interfac ...
- An Introduction to Stock Market Data Analysis with R (Part 1)
Around September of 2016 I wrote two articles on using Python for accessing, visualizing, and evalua ...
- Generic recipe for data analysis with general linear model
Generic recipe for data analysis with general linear model Courtesy of David Schneider State populat ...
- 《利用Python进行数据分析: Python for Data Analysis 》学习随笔
NoteBook of <Data Analysis with Python> 3.IPython基础 Tab自动补齐 变量名 变量方法 路径 解释 ?解释, ??显示函数源码 ?搜索命名 ...
- Python for Data Analysis
Data Analysis with Python ch02 一些有趣的数据分析结果 Male描述的是美国新生儿男孩纸的名字的最后一个字母的分布 Female描述的是美国新生儿女孩纸的名字的最后一个字 ...
- Learning Spark: Lightning-Fast Big Data Analysis 中文翻译
Learning Spark: Lightning-Fast Big Data Analysis 中文翻译行为纯属个人对于Spark的兴趣,仅供学习. 如果我的翻译行为侵犯您的版权,请您告知,我将停止 ...
- 深入浅出数据分析 Head First Data Analysis Code 数据与代码
<深入浅出数据分析>英文名为Head First Data Analysis Code, 这本书中提供了学习使用的数据和程序,原书链接由于某些原因不 能打开,这里在提供一个下载的链接.去下 ...
- How to use data analysis for machine learning (example, part 1)
In my last article, I stated that for practitioners (as opposed to theorists), the real prerequisite ...
随机推荐
- 移动端touch、click、tap的区别
一.click 与tap比较 click与tap都会出发点击事件,但是在手机web端,click会有200-300ms延迟,所以一般用tap(轻击)代替click作为点击事件.singleTap 和 ...
- keycloak~自定义rest接口
rest资源 对于我们集成keycloak来说,你可能会遇到它没有实现的功能,这时需要对kc进行扩展,资源的扩展是其中一个方面,它需要实现RealmResourceProvider和RealmReso ...
- Linux安全攻防:使用TRAP实现持续控制和提权
ATT&CK TRAP技术说明 在ATT&CK中,TRAP属于事件触发执行的一种技术,可以用于持续控制(persistence)和提权(privilege escalation). T ...
- Postgresql:postgres命令行导入sql文件
sql文件导入 psql -d jdbc -h localhost -p 5432 -U postgres -f /home/sql/test.sql #-d 数据库名称 #-h ip地址 #-p 端 ...
- 15 shell for循环
除了 while 循环和 until 循环,Shell 脚本中还有for 循环,for 循环有两种使用形式:C语言风格的for循环与Python语言风格的for in循环,两种形式的for循环用法对比 ...
- <c:out>标签不能正确输出value中的值
问题: 我打算在jsp中输出request中的值,它的key为username, <c:out value="${requestScope.username}"/> 但 ...
- Shell脚本对Linux进行文件校验
Shell脚本对Linux进行文件校验 一.需求 有客户等保需求对文件一致性进行校验,想到利用md5sum工具,因此写脚本来对文件进行自定义扫描,后期可以利用其进行校验,快速校验文件发现变更的文件,一 ...
- 在SublimeText3中搭建Verilog开发环境记录(二)
接上文 SublimeText3中搭建Verilog开发环境记录(一) 在实现了基础功能后,继续添加插件,让功能更为完善: 快速创建代码模块(snippet) Ctrl+鼠标左键实现模块跳转 通过iV ...
- ClickHouse学习系列之八【数据导入迁移&同步】
背景 在介绍了一些ClickHouse相关的系列文章之后,大致对ClickHouse有了比较多的了解.它是一款非常优秀的OLAP数据库,为了更好的来展示其强大的OLAP能力,本文将介绍一些快速导入大量 ...
- Day9 数组 冒泡排序及稀疏数组!
数组 数组是相同类型数据的有序集合. 数组描述的是相同类型的若干个数据,按照一定的先后次序排列组合而成. 其中,每一个数据称作一个数组元素,每个数组元素可以通过一个下标来访问它们.(下标从0开始) 数 ...