欢迎来到天天文库
浏览记录
ID:40509232
大小:23.07 KB
页数:7页
时间:2019-08-03
《代码静态检查报告-会务会展》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库。
1、会务会展静态代码检测报告检测工具:FindBugsFindBugs通过检查类文件或JAR文件,将字节码与一组缺陷模式进行对比从而发现代码缺陷,完成静态代码分析。FindBugs既提供可视化UI界面,同时也可以作为Eclipse插件使用。文本将主要使用将FindBugs作为Eclipse插件。在安装成功后会在eclipse中增加FindBugsperspective,用户可以对指定Java类或JAR文件运行FindBugs,此时FindBugs会遍历指定文件,进行静态代码分析。系统检测结果整理如下:(1)Scary(7):1)Highconfidence(4):①Imp
2、ossibleCast(3):Bug:Impossiblecastfromorg.activiti.bpmn.model.SequenceFlowtoorg.activiti.bpmn.model.UserTaskincom.hte.util.ActFlowUtils.addStartEventComment(String)ThiscastwillalwaysthrowaClassCastException.FindBugstrackstypeinformationfrominstanceofchecks,andalsousesmorepreciseinformati
3、onaboutthetypesofvaluesreturnedfrommethodsandloadedfromfields.Thus,itmayhavemorepreciseinformationthatjustthedeclaredtypeofavariable,andcanusethistodeterminethatacastwillalwaysthrowanexceptionatruntime.Rank:Scary(9),confidence:HighPattern:BC_IMPOSSIBLE_CASTType:BC,Category:CORRECTNESS(C
4、orrectness)a)D:/Issmart/HTExhibition/HTExhibition/src/com/hte/util/ActFlowUtils.java:350Impossiblecastfromorg.activiti.bpmn.model.SequenceFlowtoorg.activiti.bpmn.model.UserTaskincom.hte.util.ActFlowUtils.getNextFlowNodesByInstance(String,String)[Scary(9),Highconfidence]7a)D:/Issmart/HTE
5、xhibition/HTExhibition/src/com/hte/util/ActFlowUtils.java:340Impossiblecastfromorg.activiti.bpmn.model.SequenceFlowtoorg.activiti.bpmn.model.UserTaskincom.hte.util.ActFlowUtils.getNextFlowNodesByInstance(String,String)[Scary(9),Highconfidence]b)D:/Issmart/HTExhibition/HTExhibition/src/c
6、om/hte/util/ActFlowUtils.java:406Impossiblecastfromorg.activiti.bpmn.model.SequenceFlowtoorg.activiti.bpmn.model.UserTaskincom.hte.util.ActFlowUtils.addStartEventComment(String)[Scary(9),Highconfidence]②Possiblenullpointerdereference(1):Bug:PossiblenullpointerdereferenceofpaymentOrderin
7、com.hte.service.impl.ExhiPaymentOrderServiceImpl.delPaymentOrderInfo(Long)Thereisabranchofstatementthat,ifexecuted,guaranteesthatanullvaluewillbedereferenced,whichwouldgenerateaNullPointerExceptionwhenthecodeisexecuted.Ofcourse,theproblemmightbethatthebranchorstatementisinfeasi
此文档下载收益归作者所有