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; ...
随机推荐
- IIS最小配置
目的 : IIS按需要配置练习 测试环境 IIS 10 WIN10 1.安装IIS与建立网站 安装IIS略,服务器版用添加角色,用户版添加删除WINDOWS组件. 装好IIS之后,建一个网 ...
- cf1073G Yet Another LCP Problem (SA+权值线段树)
反正先求一遍sa 然后这个问题可以稍微转化一下 默认比较A.B数组中元素的大小都是比较它们rank的大小,毕竟两个位置的LCP就是它们rank的rmq 然后每次只要求B[j]>=A[i]的LCP ...
- Bomb HDU - 5934 (Tarjan)
#include<map> #include<set> #include<ctime> #include<cmath> #include<stac ...
- Mysql 系统表
Information_schema: 1. tables 提供表信息: 表所属数据库,表名,表类型,行数,最大自增数等等.
- hdu2586How far away ?(LCA LCATarjan离线)
题目链接:acm.hdu.edu.cn/showproblem.php?pid=2586 题目大意:有n个点,同n-1条带有权值的双向边相连,有m个询问,每个询问包含两个数x,y,求x与y的最短距离. ...
- Docker安装及常用命令
修改机器名: [root@docker /]# hostnamectl set-hostname Docker 安装EPEL源: [root@docker /]# yum -y install epe ...
- 第六篇-以隐式意图(Implicit Intent)呼叫系统服务
一.新建一个layout5.xml,同样换为constriant模式. 二.拖动两个Button到预览界面,第一个按钮名字改为DISPLAY WEBPAGE,第二个按钮名字改为MAKE A CALL. ...
- Freemarker 的 Eclipse 插件 安装
clipse版本(目前最新oxygen) 如果你的eclipse版本为Oxygen "Help" ---> "Eclipse Marketplace..." ...
- typescript和coffeescript简介
typescript 1.什么是typescript?和JavaScript有什么关系? 1.它是一门独立的语言,实现了自己的编译器 2.它的目标代码是JavaScript(很多语言的目标代码是机 ...
- 5.django学习模型
##Django Models ##编写models 1.在应用根目录下创建models.py并引入models模块,创建类,继承models.Model该类即是一张数据表 2.字段创建 ##映射数据 ...