Installation and use of FindBugs plugins in eclipse

Source: Internet
Author: User

1. What is FindBugs
FindBugs is an open source Java static Code analysis tool provided by the University of Maryland. FindBugs by examining a class file or JAR file, the bytecode is compared to a set of defect patterns to uncover code flaws and complete static code analysis. The FindBugs provides both a visual UI interface and can be used as an Eclipse plugin.

FindBugs is an open source Eclipse Code Checker, which helps us to discover the bug,bad smell and potential pitfalls that exist in program code in a simple and efficient manner. For various problems, it also provides a simple modification of the comments for us to reconstruct the reference, by using it, can reduce the workload of our code review to some extent, and will improve the efficiency of review. Through FindBugs to find bugs, and then by our own refactoring code, we can cultivate our coding awareness and level, the formation of good habits to improve the development of coding ability.
2, how to install findbugs? As a plug-in for Eclipse, you can integrate FindBugs into eclipse. The first is an online installation: Enter Http://findbugs.cs.umd.edu/eclipse in the plug-in installation address of Eclipse and "next" to install successfully.
The second way is to download the FindBugs plugin, put it into the Plusin folder under Eclipse, and then restart Eclipse.
Open Eclipse->window->preferences, search for the keyword findbugs, if you can find the configuration item, then the installation is successful.


3. How to use FindBugs
After installing the FindBugs plugin. Right click on the item you want to check select "Find Bugs", "Find Bugs" to check. To see what Bugs findbugs checked out, you can open the Bug Explorer panel by choosing Windows menu->show View->bug Explorer. If you want to see detailed information about a bug, you can choose the Windows menu->open perspective, and then select FindBugs to open the Properties panel for FindBugs. In this panel you can see the most detailed bugs information.
Once the Bugs Explorer has been added, we can look at the bugs we just found, as shown in the figure:


The bugs found are 3 colors,BlackThe bug marks are classified,RedBug indicates that the code must be modified after a serious bug is found,Orange ColorBugs indicate potential warning bugs to be modified as much as possible.
Double-click the bug item to automatically open the relevant code file and connect to the code snippet in the edit window on the right. Clicking on the little bug icon next to the line number will provide a detailed description of the bug, as well as suggestions for changes, in the output area below eclipse. We can make changes based on this information.
4, FindBugs can find all the bug types

Depending on the nature of the defect, it can be broadly divided into the following categories

· Bad practice.

· Correctness may not be correct

· Dodgy code bad codes

· Experimental experiment

· Internationalization internationalization

· Malicious Code vulnerility Malware Vulnerability

· Multithreaded correctness multithreading problems

· Performance Performance Issues

Some examples are also given on the official website of FindBugs:

Http://findbugs.sourceforge.net/bugDescriptions.html
reference Suorceforge Address: http://findbugs.sourceforge.net/Official Documentation: Http://findbugs.sourceforge.net/manual

Related Article

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.