When people talk about code rule engines. Everyone likes to stand in his place and say what he prefers, and reject other tools.
For instance, a PMD supporter could say:"Checkstyle is a stupid tool consuming time to search for tab characters when PMD is a smart one," can do the job alone As a good soldier, Findbugs is very good for resource consumption and macker
1. decompress the package;2, cd./qatools/pmd-bin-5.0.4/bin3. Modify exec_pmd.sh to modify the directory to be checked.
Take useless code check as an example. The original content is:./run. sh pmd-d/home/wuhe. jyh/xxx/yyy/-rulesets java-unusedcode> unusedcode.txt
The red font part is the directory to be checked. The source code is checked by the pmd component. you
Java advanced (iv) ------ java programming specifications --- installation of FindBugs, PMD, and CheckStyle code quality detection tools
Here, the plug-in is used to install FindBugs, PMD, and CheckStyle for myeclipse.
You can search for checkstyle, pmd, and findbugs to find their corresponding plug-ins.
There are three installation methods for plug-ins. I
Plug-in installation address https://dl.bintray.com/pmd/pmd-eclipse-plugin/updates/
Detailed Enquiry: https://sourceforge.net/projects/pmd/files/pmd-eclipse/update-site/
If you had previously installed a version of the PMD Eclipse plugin prior to November and then you shou
Before formally entering the test, it is helpful to do some static code analysis and code review to improve the quality and the system, the above is the data proofPMD It is a Java source code parser based on a static rule set that identifies potential problems such as:– Possible bug--empty try/catch/finally/switch blocks.– Useless codes (Dead code): Useless local variables, method arguments, and private methods.– An empty If/while statement.– Overly complex expressions-unnecessary if statements,
provides timely feedback to the coder, which is not a project management tool and does not focus on the implementation of the project from functional analysis to design coding, to testing the whole process.(ii) installationDownload and install Sourcemontor from official website, after installation(iii) Use(1) The new project is shown as follows:(2) Select the development language, such as Java,(3) Fill in the new file name and select the path,(4) Sel
I. Installation and Use of PMD(1) Installation of PMD-Online Installation1. Open eclipse and select help-install new software.2. In the pop-up install dialog box, select the Add button3. Fill in the plug-in name: PMD in name, and enter the plug-in address: http://sourceforge.net/projects/pm/files/pmd-eclipse/update-sit
PMD and Checkstyle
Depending on the PMD document, it checks the following sections in your code:
Unused local variablesAn empty catch blockParameter not usedEmpty if statementDuplicate import statementUnused private methodsCould be a singletons class.Short/Long variable and method nameCheckstyle Check the following sections:
Javadoc annotationNaming conventionsTitleImport statementVolume sizeBlankModifiersB
1) failed to check with multiple rule sets at a time
Command line:
E:/software/pmd-2.3/bin> pmd c:/test. Java HTML rulesets/unusedcode. XML, rulesets/basic. xml
Running result:
Sample source code:
Import java. util. arraylist;
Import java. util .*;
Public class test {
Public static void main (string [] ARGs ){
Try {
Int I = 0;
If (I> 0 ){}
System. Out. println ("Hello world! ");
} Catch (exception e ){
} Fi
1. Build Jenkins
Reference: Http://blog.csdn.net/xiaofei125145/article/details/51144827?locationNum=1 2, install DRY plugin
DRY Plug-in
3. Download PMD
https://sourceforge.net/projects/pmd/files/pmd/4, decompression PMD and placed in the designated directory
I placed it in the ~/p
Before formally entering the test, it is helpful to do some static code analysis and code review to improve the quality and the system, the above is the data proofPMD It is a Java source code parser based on a static rule set that identifies potential problems such as:– Possible bug--empty try/catch/finally/switch blocks.– Useless codes (Dead code): Useless local variables, method arguments, and private methods.– An empty If/while statement.– Overly complex expressions-unnecessary if statements,
Java advanced (iii) ------ java programming specifications-Comparison of FindBugs, PMD, and CheckStyle code quality detection tools
In the previous article, we have learned how to automatically set the code format in myeclipse.
During the development process, we will find that we do not have much time to perform code check and review. However, we can use tools to automatically check the code to improve work efficiency. FindBugs,
PMD ErrorAvoid autogenerated methods to access private fields and methods of inner / outer classesSample Examplepublic class Test { public static void main(final String[] args) { //code } public void test(){ Executors.newSingleThreadExecutor().execute(new Thread() { @Override public void run() { final int a = getNum(); System.out.println(a); } }); } priv
Read and display of models in PMD format
It has been May, and it took more than ten days to study the results. Write a log to commemorate it.It is a three-dimensional model format and is mainly used in mikumikudance and pmdeditor. There are fewer descriptions about the format, so my research mainly involves the MMD library of itsuhane.The PMD format file is also a simple binary file, because the file form
The PMD plugin installation address is: Http://pmd.sourceforge.net/eclipse
After the PMD plug-in is installed, it consists of 2 parts: CPD and PMD.
CPD is used to check for repetitive code (for example, by copying and pasting the resulting code)
Use it very simply, right click on your item, select Find suspect cut and Paste:
Then select the language and out
Plugin InstallationIf you had previously installed a version of the PMD Eclipse plugin prior to November and then you should remove/uninst All it first. To install the PMD for Eclipse plugin:1. In Eclipse, click on Help, Install New software ...2. Click on Add :3. Enter the following:Name: PMD for Eclipse Update SiteURL: http://sourceforge.net/projects/
A PMD document that examines the following sections of code:
Unused local variables
An empty catch block
Parameter not used
Empty if statement
Duplicate import statement
Unused private methods
Could be a singletons class.
Short/Long variable and method name
Checkstyle Check the following sections:
Javadoc annotation
Naming conventions
Title
Import statement
Volume size
Blank
Modifiers
Block
Mixed Check (pack live some useful, such as System.out and
Put my latest updated MyEclipse2014 integrated PMD code detection plug-in custom rule profile Java version released, to facilitate their future review, but also to see if they can help to have this need of small partners. FileName: cplatform_pmd5.2.3_rules.xml
1. After installation start Jenkins, in Manage Jenkins, select Manage plugin, install related available in Plugins tab
FindBugs Plug-inThis plug-in collects the FindBugs analysis results of the project modules and visualizes found.If you like this open source plug-in consider supporting I work by buying my Android game Inca.Jenkins Cobertura PluginThis is plugin integrates Cobertura coverage reports to Jenkins.PMD Plug-inThis is plug-in collects the PMD
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.