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:

  1. ./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.的更多相关文章

  1. Fortify Scan - Static Code Analyzer

    https://software.microfocus.com/en-us/products/application-security-testing/overview https://softwar ...

  2. Top 40 Static Code Analysis Tools

    https://www.softwaretestinghelp.com/tools/top-40-static-code-analysis-tools/ In this article, I have ...

  3. 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- ...

  4. XML EXtensible Markup Language

    1.基础:XML设计被用来传输和存储数据:全称是EXtensible Markup Language.它的设计宗旨是传输数据,而不是显示数据.xml的标签没有被预定义,需要由用户自行定义标签.xml被 ...

  5. Object constraint language for code generation from activity models

    一.基本信息 标题:Object Constraint Language for Code Generation from Activity Models 时间:2018 出版源:Informatio ...

  6. matlab M文件分析工具使用(Code Analyzer and Profiler)

    Code Analyzer and Profiler Matlab中,对写在m文件(.m文件)里的代码有分析的工具,可以进行优化,这里做一个简单的介绍. Code Analyzer Code Anal ...

  7. XML简介——可扩展标记语言(Extensible Markup Language)

    (What) XML是什么? XML指可扩展标记语言(Extensible Markup Language) 1.  XML是一种标记语言,类似HTML. 2.  XML具有自我描述性 3.  XML ...

  8. source code analyzer 功能强大的C/C++源代码分析软件 Celerity CRACK 破解版

    特色 迅捷是一个功能强大的C/C++源代码分析软件.可以处理数百万行的源程序代码.支持标准及K&R风格的C/C++.对每一个打开的源代码工程,通过建立一个包含丰富交叉引用关系的数据库,显示其所 ...

  9. 原始的Ajax方法 (异步的 JavaScript 和 XML -- (Extensible Markup Language 可扩展标记语言))

    <script language="javascript" type="text/javascript"> var request = false; ...

随机推荐

  1. <Android基础>(二) Activity Part 2

    1.活动生命周期 1)返回栈 2)活动状态 3)活动的生存期 2.活动的启动模式 1)standard 2)singleTop 3)singleTask 4)singleInstance 3.活动的优 ...

  2. docker-compose.yml(2)

    实例2:version: '3'services: user-service: image: "$DOCKER_SERVICE_IMAGE_TAG" network_mode: & ...

  3. LaTex in Markdown

      上次写了Markdown,这次用到了LaTex,也出一期(吐槽,工作量比Markdown高太多...) Markdown基础:https://www.cnblogs.com/dotnetcrazy ...

  4. 借网站日记分析~普及一下Pandas基础

      对网站日记分析其实比较常见,今天模拟演示一下一些应用场景,也顺便说说Pandas,图示部分也简单分析了下 1.数据清洗¶ 一般数据都不可能直接拿来用的,或多或少都得清理一下,我这边就模拟一下清洗完 ...

  5. Duplicate entry 'xxx' for key 'xxx'

    插入数据的时候 报错,Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: Duplic ...

  6. navicat primium 快捷键与命令

    1.ctrl+q          打开查询窗口 2.ctrl+/           注释sql语句 3.ctrl+shift +/  解除注释 4.ctrl+r          运行查询窗口的s ...

  7. A1113. Integer Set Partition

    Given a set of N (> 1) positive integers, you are supposed to partition them into two disjoint se ...

  8. 2018最完整ITTO分节整理指导(PMP项目管理入门必备)

    2018年项目管理基础教材<PMBOK>指南进行了改版,之前的一些PMP资料没有太大帮助,反而会让大家记忆混淆,用最新的会好一些,今天小编就把搜集到的2018年项目管理最详细的ITTO的P ...

  9. java远程下载图片

    从别的网站复制文章的时候,要把图片下载到我们网站,再把图片地址换成我们网站的地址 <img id="mbkenHUwhWeOj9U8K6c8LlAXaes3oXit-M4SnmRvB4 ...

  10. Altium Designer 18 ------ 原理图和PCB元器件互相查找

    方法一:单击选中原理图中元器件,然后单击tools>Seclect PCBcomponents,即可在PCB中看到该器件的高亮显示: 方法二:单击Tools>Cross Select Mo ...