Detect bugs from Java code using FindBugs



Download 0,64 Mb.
bet2/6
Sana05.06.2022
Hajmi0,64 Mb.
#638201
1   2   3   4   5   6
Bog'liq
asd 1

plugin>
<groupId>org.codehaus.mojogroupId>
<artifactId>findbugs-maven-pluginartifactId>
<version>3.0.4version>
<configuration>
<effort>Maxeffort>
configuration>
<executions>
<execution>
<goals>
<goal>checkgoal>
goals>
execution>
executions>
plugin>
The effort – when maxed out, performs a more complete and precise analysis, revealing more bugs in the code, though, it consumes more resources and takes more time to complete.
You can now run the command mvn verify, to check if the build will succeed or not – depending on the defects detected while running the analysis.
You can also enhance the report generation process and take more control over the analysis, by adding some basic configuration to the plugin declaration:
<configuration>
<onlyAnalyze>org.baeldung.web.controller.*onlyAnalyze>
<omitVisitors>FindNullDerefomitVisitors>
<visitors>FindReturnRefvisitors>
configuration>
The onlyAnalyze option declares a comma separated values of classes/packages eligible for analysis.
The visitors/omitVisitors options are also comma separated values, they are used to specify which detectors should/shouldn't be run during the analysis – Note that visitors and omitVisitors cannot be used at the same time.
A detector is specified by its class name, without any package qualification. Find the details of all detectors class names available by following this link.

The IDE installation of the FindBugs Plugin is pretty straightforward – you just need to use the software update feature in Eclipse, with the following update site: http://findbugs.cs.umd.edu/eclipse.


To make sure that FindBugs is properly installed in your Eclipse environment, then, look for the option labeled FindBugs under Windows -> Preferences -> Java.
In order to launch a static analysis on a project using the FindBugs Eclipse plugin, you need to right-click the project in the package explorer, then, click on the option labeled find bugs.
After launch, Eclipse shows the results under the Bug Explorer window as shown in the screenshot below:


As of version 2, FindBugs started ranking bugs with a scale from 1 to 20 to measure the severity of defects:
1   2   3   4   5   6




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©hozir.org 2024
ma'muriyatiga murojaat qiling

kiriting | ro'yxatdan o'tish
    Bosh sahifa
юртда тантана
Боғда битган
Бугун юртда
Эшитганлар жилманглар
Эшитмадим деманглар
битган бодомлар
Yangiariq tumani
qitish marakazi
Raqamli texnologiyalar
ilishida muhokamadan
tasdiqqa tavsiya
tavsiya etilgan
iqtisodiyot kafedrasi
steiermarkischen landesregierung
asarlaringizni yuboring
o'zingizning asarlaringizni
Iltimos faqat
faqat o'zingizning
steierm rkischen
landesregierung fachabteilung
rkischen landesregierung
hamshira loyihasi
loyihasi mavsum
faolyatining oqibatlari
asosiy adabiyotlar
fakulteti ahborot
ahborot havfsizligi
havfsizligi kafedrasi
fanidan bo’yicha
fakulteti iqtisodiyot
boshqaruv fakulteti
chiqarishda boshqaruv
ishlab chiqarishda
iqtisodiyot fakultet
multiservis tarmoqlari
fanidan asosiy
Uzbek fanidan
mavzulari potok
asosidagi multiservis
'aliyyil a'ziym
billahil 'aliyyil
illaa billahil
quvvata illaa
falah' deganida
Kompyuter savodxonligi
bo’yicha mustaqil
'alal falah'
Hayya 'alal
'alas soloh
Hayya 'alas
mavsum boyicha


yuklab olish