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 ...
随机推荐
- Java Set HashSet
import java.util.HashSet; import java.util.Set; /** Set存储特点:数据无序.不可重复 Set接口的实现类: HashSet:Set接口的主要实现类 ...
- Jenkins 进阶篇 - 权限配置
Jenkins的授权策略 Jenkins 默认的授权策略是[登录用户可以做任何事],也就是人人都是管理员,可以修改所有的设置以及构建所有的任务,不用做任何设置,有账号登录到 Jenkins 系统即可, ...
- Ubuntu创建图标
起因 安装一些软件时,总是没有图标,导致无法固定到docky栏,所以极为不方便,所以需要自己创建图标. 操作 以创建微信图标为例 [Desktop Entry] Name=Wecaht #名字 Com ...
- Adaptive AUTOSAR 学习笔记 1 - Overview
缩写 AP: AUTOSAR Adaptive Platform CP: AUTOSAR Classic Platform AA: Adaptive Application ARA: AUTOSAR ...
- TCP连接的11种状态
传输控制协议(TCP,Transmission Control Protocol)是一种面向连接的.可靠的.基于字节流的传输层通信协议.TCP协议主要针对三次握手建立连接和四次挥手断开连接,其中包括了 ...
- stream之map的用法
一.Stream管道流map的基础用法 最简单的需求:将集合中的每一个字符串,全部转换成大写! List<String> alpha = Arrays.asList("Monke ...
- 在SublimeText3中搭建Verilog开发环境记录(二)
接上文 SublimeText3中搭建Verilog开发环境记录(一) 在实现了基础功能后,继续添加插件,让功能更为完善: 快速创建代码模块(snippet) Ctrl+鼠标左键实现模块跳转 通过iV ...
- IO流 connect reset
目录 出现场景 解决思路 出现场景 通过外部OBS下载10文件,然后通过工具将这10个文件打包成一个文件A.zip上传,最后将这个A.zip下载并解压,解压A.zip后发现文件数量不是10个. 解决思 ...
- 记录一些css奇淫技巧
文本两端对齐 文字在固定宽度内两端对齐 text-align: justify; text-align-last: justify; 滤镜filter 元素(经常用作图片)置灰效果,类似disable ...
- 【洛谷P4933 大师】动态规划
题目描述 ljt12138首先建了n个特斯拉电磁塔,这些电塔排成一排,从左到右依次标号为1到n,第i个电塔的高度为h[i]. 建筑大师需要从中选出一些电塔,然后这些电塔就会缩到地下去.这时候,如果留在 ...