当前位置:网站首页>手把手系列---安装SpotBugs、并快速上手使用
手把手系列---安装SpotBugs、并快速上手使用
2022-06-29 06:39:00 【最佳听众!】
手把手系列
前言
在使用FindBugs的时候,发现适用Idea的FindBugs已经在2016年的时候停止维护了, 不再兼容IDEA2020,
于是有了这期,包含了如何去安装spotBugs,以及如何去使用spotBugs。
提示:以下是本篇文章正文内容
一、SpotBugs是什么?
官网介绍:SpotBugs是一个使用静态分析来查找Java代码中的错误的工具,SpotBugs 需要 JRE(或 JDK)1.8.0 或更高版本才能运行。但是,它可以分析为从1.0到1.9的任何Java版本编译的程序。
静态分析:检查Java字节码(.class文件)是否存在错误。
二、SpotBugs 的下载
1.在线安装(三步)



点击install 安装
2.网页下载
登陆官网(官网会自动匹配相对应的版本,前提是启动idea)
https://plugins.jetbrains.com/plugin/14014-spotbugs/versions
百度云下载到本地
链接:https://pan.baidu.com/s/1QRqFWJISn1ZIjShzxaxeKg
提取码:9xwt
用Install Plugin from Disk安装本地包,然后重启。
三、使用SpotBugs
常用配置SpotBugS



spotbugs主要包括10大类bug
1.Bad practice(90余种)不良的实践,违反常识性的或者必要的代码惯例,比如重写了equals却没有重写hashcode。
2.Correctness (150余种) 此处的代码有可能在运行时导致错误,与预期不符,比如空指针错误。
3.Experimental(9种)spotbugs在此处不适用,大概是匹配模式不太适用于此处。
4.Internationalization(2种)原文是:code flaws having to do with internationalization and locale,没有遇到过类似的错误。
5.Malicious code vulnerability(17种)代码具有被恶意代码攻击的风险。比如返回一个可变类型引用并保存在对象字段中。
6.Multithreaded correctness(46种)线程安全,比如可能造成死锁的代码。
7.Bogus random noise(4种)并不是软件中的实际错误。
8.Performance(37种)性能不好的代码,比如在迭代中使用“+”连接字符串。
9.Security(11种)使用了不安全的外部输入,可能导致远程控制的漏洞。
10.Dodgy(87种)导致自身混乱的代码
使用
1选择相对应的包或者类
2查看结果,并对结果分析
总结
合理的使用工具,能帮助我们大大的简化工作难度,SpotBugs的使用能够让我们的代码更加规范化。
如果觉得有帮助可以点赞收藏支持一下,如果能关注一下就再好不过了ヾ(≧▽≦*)o
边栏推荐
- KingbbaseES V8R6集群维护案例之---集群之间数据迁移
- 软件测试鸾音鹤信
- Viewing application and installation of Hana database license
- Matlab Simulink simulation and analysis of power grid sweep frequency
- Use of LSTM neural network and general neural network
- Perceiving healthy life, enabling boundless connection -- contributing to openharmony 3.1 ecological construction
- Simulation analysis of sailing dynamics
- [translation] swarmed out. Design methods for building modern applications
- 编译原理王者之路
- 101. 对称二叉树(递归与迭代方法)
猜你喜欢

cv2.cvtColor

Imx6dl4.1.15 supports EIM bus (upper) - actual operation and modification.
![[FreeRTOS] interrupt mechanism](/img/ab/9b1d07048b4631d7cc95db99ed529a.png)
[FreeRTOS] interrupt mechanism

excel高级绘图技巧100讲(六)-甘特图在项目进度上的实战应用案例

1183:病人排队

Concurrent idempotent anti shake

MFC中利用CDockablePane实现悬浮窗

Reflection modification final

Schnuka: what is visual positioning system? How visual positioning system works

Kingbasees v8r6 cluster maintenance case -- single instance data migration to cluster case
随机推荐
施努卡:视觉定位系统厂家 什么是视觉定位系统
帆船动力学仿真分析
Markdown skill tree (8): code blocks
358. K 距离间隔重排字符串 排序
TREE ALV 展开Node或者点击Toolbar按钮时DUMP(CL_ALV_TREE_BASE==============CP|SET_ITEMS_FOR_COLUMN)
ShapeShifter: Robust Physical Adversarial Attack on Faster R-CNN Object Detector
施努卡:3d机器视觉检测系统 3d视觉检测应用行业
IMX6DL4.1.15支持EIM总线(下)——配置原理分析。
Alternative writing of if else in a project
Roblox剑九之剑二
DataTables screen error Popup
Schnuka: visual positioning system manufacturer what is a visual positioning system
Comment choisir les fournisseurs de marques CRM dans l'industrie du vêtement?
KingbbaseES V8R6集群维护案例之---集群之间数据迁移
tf.to_int64
Alicloud access resource: nosuchkey
如何给下属进行授权?
Es query syntax
Schnuka: 3D machine vision inspection system 3D vision inspection application industry
Mmclassification installation and debugging