PMD -- An extensible cross-language static code analyzer.
PMD
An extensible cross-language static code analyzer.
https://github.com/pmd/pmd
跨语言静态代码分析工具。可以查找通用的编码错误,例如 未使用的变量、空catch块、非必须的对象创建、等等。
另外,它也包括CPD工具, 复制-黏贴-检查工具。可以检查出代码中的重复部分。
PMD is a source code analyzer. It finds common programming flaws like unused variables, empty catch blocks, unnecessary object creation, and so forth. It supports Java, JavaScript, Salesforce.com Apex and Visualforce, PLSQL, Apache Velocity, XML, XSL.
Additionally it includes CPD, the copy-paste-detector. CPD finds duplicated code in Java, C, C++, C#, Groovy, PHP, Ruby, Fortran, JavaScript, PLSQL, Apache Velocity, Scala, Objective C, Matlab, Python, Go, Swift and Salesforce.com Apex and Visualforce.
Welcome to PMD
https://pmd.github.io/pmd-5.8.1/
能处理以下潜在的问题:
1、 可能的bug -- 空特定语句块。
2、无效代码 -- 未使用的局部变量、参数、私有方法。
3、次优代码 -- 浪费使用 String StringBuffer。
4、过于复杂的表达式 -- 非必要的if语句、for语句。
5、重复代码 -- 拷贝-复制方式生成的代码。
PMD scans source code in Java and other languages and looks for potential problems like:
- Possible bugs - empty try/catch/finally/switch statements
- Dead code - unused local variables, parameters and private methods
- Suboptimal code - wasteful String/StringBuffer usage
- Overcomplicated expressions - unnecessary if statements, for loops that could be while loops
- Duplicate code - copied/pasted code means copied/pasted bugs
重复代码检查
https://pmd.github.io/pmd-5.8.1/usage/cpd-usage.html
For Linux, there is since PMD 5.0 a combined start script for all command line tools. This includes CPD. The start script is called run.sh and is located in the bin subdirectory in the PMD binary distribution zip-file. Let’s assume, you are in this directory, then you can start CPD this way:
- ./run.sh cpd --minimum-tokens 100 --files c:\temp\src\java
The options “minimum-tokens” and “files” are the two required options; there are more options, see below.
。。。。
PMD -- An extensible cross-language static code analyzer.的更多相关文章
- Fortify Scan - Static Code Analyzer
https://software.microfocus.com/en-us/products/application-security-testing/overview https://softwar ...
- Top 40 Static Code Analysis Tools
https://www.softwaretestinghelp.com/tools/top-40-static-code-analysis-tools/ In this article, I have ...
- The Ultimate List of Open Source Static Code Analysis Security Tools
https://www.checkmarx.com/2014/11/13/the-ultimate-list-of-open-source-static-code-analysis-security- ...
- XML EXtensible Markup Language
1.基础:XML设计被用来传输和存储数据:全称是EXtensible Markup Language.它的设计宗旨是传输数据,而不是显示数据.xml的标签没有被预定义,需要由用户自行定义标签.xml被 ...
- Object constraint language for code generation from activity models
一.基本信息 标题:Object Constraint Language for Code Generation from Activity Models 时间:2018 出版源:Informatio ...
- matlab M文件分析工具使用(Code Analyzer and Profiler)
Code Analyzer and Profiler Matlab中,对写在m文件(.m文件)里的代码有分析的工具,可以进行优化,这里做一个简单的介绍. Code Analyzer Code Anal ...
- XML简介——可扩展标记语言(Extensible Markup Language)
(What) XML是什么? XML指可扩展标记语言(Extensible Markup Language) 1. XML是一种标记语言,类似HTML. 2. XML具有自我描述性 3. XML ...
- source code analyzer 功能强大的C/C++源代码分析软件 Celerity CRACK 破解版
特色 迅捷是一个功能强大的C/C++源代码分析软件.可以处理数百万行的源程序代码.支持标准及K&R风格的C/C++.对每一个打开的源代码工程,通过建立一个包含丰富交叉引用关系的数据库,显示其所 ...
- 原始的Ajax方法 (异步的 JavaScript 和 XML -- (Extensible Markup Language 可扩展标记语言))
<script language="javascript" type="text/javascript"> var request = false; ...
随机推荐
- dns配置文件
/etc/resolv.conf 该文件是DNS域名解析的配置文件,它的格式很简单,每行以一个关键字开头,后接配置参数. resolv.conf的关键字主要有四个,分别是: nameserver ...
- Mysql 允许远程连接
授权的方式允许任何主机访问mysql服务器: mysql>GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'password' W ...
- Python3 与 C# 扩展之~模块专栏
代码裤子:https://github.com/lotapp/BaseCode/tree/maste 在线编程:https://mybinder.org/v2/gh/lotapp/BaseCode ...
- Hello Object Oriented!
继计组之后,北航计算机学院又一大神课! 希望能以此为契机,和更多热爱技术的朋友们交流.让我们一起,共同进步~ [2019.4.27更新] 建立博客园的最初目的,是为了北航计算机学院OO课程设计的需要. ...
- 51Nod--1076 2条不相交的路径(强连通分量)
电波 #include<bits/stdc++.h> using namespace std; #define LL long long #define maxn 30000 vector ...
- Linux:文件系统层次结构标准(Filesystem Hierarchy Standard)
Linux FHS_2.3标准文档:http://refspecs.linuxfoundation.org/FHS_3.0/fhs-3.0.pdf
- js jquery select 操作 获取值,选中选项,增加,修改,删除
select示例: <select id="sel"> <option value="1">one</option> < ...
- django orm跨表查询废话最少最精简版
在model.py中: class B1(models.Model): u1= models.CharField(max_length=32) #多 class B2(models.Model): f ...
- The 2018 ACM-ICPC Asia Beijing Regional Contest
http://hihocoder.com/problemset/problem/ #1870 : Jin Yong’s Wukong Ranking List 我是每加1个点就dfs判断1次. 正解是 ...
- Can not issue data manipulation statements with executeQuery()错误解决
转: Can not issue data manipulation statements with executeQuery()错误解决 2012年03月27日 15:47:52 katalya 阅 ...