array(2) { ["docs"]=> array(10) { [0]=> array(10) { ["id"]=> string(3) "428" ["text"]=> string(77) "Visual Studio 2017 单独启动MSDN帮助(Microsoft Help Viewer)的方法" ["intro"]=> string(288) "目录 ECharts 异步加载 ECharts 数据可视化在过去几年中取得了巨大进展。开发人员对可视化产品的期望不再是简单的图表创建工具,而是在交互、性能、数据处理等方面有更高的要求。 chart.setOption({ color: [ " ["username"]=> string(8) "DonetRen" ["tagsname"]=> string(55) "Visual Studio 2017|MSDN帮助|C#程序|.NET|Help Viewer" ["tagsid"]=> string(23) "[401,402,403,"300",404]" ["catesname"]=> string(0) "" ["catesid"]=> string(2) "[]" ["createtime"]=> string(10) "1511400964" ["_id"]=> string(3) "428" } [1]=> array(10) { ["id"]=> string(3) "427" ["text"]=> string(42) "npm -v;报错 cannot find module "wrapp"" ["intro"]=> string(288) "目录 ECharts 异步加载 ECharts 数据可视化在过去几年中取得了巨大进展。开发人员对可视化产品的期望不再是简单的图表创建工具,而是在交互、性能、数据处理等方面有更高的要求。 chart.setOption({ color: [ " ["username"]=> string(4) "zzty" ["tagsname"]=> string(50) "node.js|npm|cannot find module "wrapp“|node" ["tagsid"]=> string(19) "[398,"239",399,400]" ["catesname"]=> string(0) "" ["catesid"]=> string(2) "[]" ["createtime"]=> string(10) "1511400760" ["_id"]=> string(3) "427" } [2]=> array(10) { ["id"]=> string(3) "426" ["text"]=> string(54) "说说css中pt、px、em、rem都扮演了什么角色" ["intro"]=> string(288) "目录 ECharts 异步加载 ECharts 数据可视化在过去几年中取得了巨大进展。开发人员对可视化产品的期望不再是简单的图表创建工具,而是在交互、性能、数据处理等方面有更高的要求。 chart.setOption({ color: [ " ["username"]=> string(12) "zhengqiaoyin" ["tagsname"]=> string(0) "" ["tagsid"]=> string(2) "[]" ["catesname"]=> string(0) "" ["catesid"]=> string(2) "[]" ["createtime"]=> string(10) "1511400640" ["_id"]=> string(3) "426" } [3]=> array(10) { ["id"]=> string(3) "425" ["text"]=> string(83) "深入学习JS执行--创建执行上下文(变量对象,作用域链,this)" ["intro"]=> string(288) "目录 ECharts 异步加载 ECharts 数据可视化在过去几年中取得了巨大进展。开发人员对可视化产品的期望不再是简单的图表创建工具,而是在交互、性能、数据处理等方面有更高的要求。 chart.setOption({ color: [ " ["username"]=> string(7) "Ry-yuan" ["tagsname"]=> string(33) "Javascript|Javascript执行过程" ["tagsid"]=> string(13) "["169","191"]" ["catesname"]=> string(0) "" ["catesid"]=> string(2) "[]" ["createtime"]=> string(10) "1511399901" ["_id"]=> string(3) "425" } [4]=> array(10) { ["id"]=> string(3) "424" ["text"]=> string(30) "C# 排序技术研究与对比" ["intro"]=> string(288) "目录 ECharts 异步加载 ECharts 数据可视化在过去几年中取得了巨大进展。开发人员对可视化产品的期望不再是简单的图表创建工具,而是在交互、性能、数据处理等方面有更高的要求。 chart.setOption({ color: [ " ["username"]=> string(9) "vveiliang" ["tagsname"]=> string(0) "" ["tagsid"]=> string(2) "[]" ["catesname"]=> string(8) ".Net Dev" ["catesid"]=> string(5) "[199]" ["createtime"]=> string(10) "1511399150" ["_id"]=> string(3) "424" } [5]=> array(10) { ["id"]=> string(3) "423" ["text"]=> string(72) "【算法】小白的算法笔记:快速排序算法的编码和优化" ["intro"]=> string(288) "目录 ECharts 异步加载 ECharts 数据可视化在过去几年中取得了巨大进展。开发人员对可视化产品的期望不再是简单的图表创建工具,而是在交互、性能、数据处理等方面有更高的要求。 chart.setOption({ color: [ " ["username"]=> string(9) "penghuwan" ["tagsname"]=> string(6) "算法" ["tagsid"]=> string(7) "["344"]" ["catesname"]=> string(0) "" ["catesid"]=> string(2) "[]" ["createtime"]=> string(10) "1511398109" ["_id"]=> string(3) "423" } [6]=> array(10) { ["id"]=> string(3) "422" ["text"]=> string(64) "JavaScript数据可视化编程学习(二)Flotr2,雷达图" ["intro"]=> string(288) "目录 ECharts 异步加载 ECharts 数据可视化在过去几年中取得了巨大进展。开发人员对可视化产品的期望不再是简单的图表创建工具,而是在交互、性能、数据处理等方面有更高的要求。 chart.setOption({ color: [ " ["username"]=> string(7) "chengxs" ["tagsname"]=> string(28) "数据可视化|前端学习" ["tagsid"]=> string(9) "[396,397]" ["catesname"]=> string(18) "前端基本知识" ["catesid"]=> string(5) "[198]" ["createtime"]=> string(10) "1511397800" ["_id"]=> string(3) "422" } [7]=> array(10) { ["id"]=> string(3) "421" ["text"]=> string(36) "C#表达式目录树(Expression)" ["intro"]=> string(288) "目录 ECharts 异步加载 ECharts 数据可视化在过去几年中取得了巨大进展。开发人员对可视化产品的期望不再是简单的图表创建工具,而是在交互、性能、数据处理等方面有更高的要求。 chart.setOption({ color: [ " ["username"]=> string(4) "wwym" ["tagsname"]=> string(0) "" ["tagsid"]=> string(2) "[]" ["catesname"]=> string(4) ".NET" ["catesid"]=> string(7) "["119"]" ["createtime"]=> string(10) "1511397474" ["_id"]=> string(3) "421" } [8]=> array(10) { ["id"]=> string(3) "420" ["text"]=> string(47) "数据结构 队列_队列实例:事件处理" ["intro"]=> string(288) "目录 ECharts 异步加载 ECharts 数据可视化在过去几年中取得了巨大进展。开发人员对可视化产品的期望不再是简单的图表创建工具,而是在交互、性能、数据处理等方面有更高的要求。 chart.setOption({ color: [ " ["username"]=> string(7) "idreamo" ["tagsname"]=> string(40) "C语言|数据结构|队列|事件处理" ["tagsid"]=> string(23) "["246","247","248",395]" ["catesname"]=> string(12) "数据结构" ["catesid"]=> string(7) "["133"]" ["createtime"]=> string(10) "1511397279" ["_id"]=> string(3) "420" } [9]=> array(10) { ["id"]=> string(3) "419" ["text"]=> string(47) "久等了,博客园官方Android客户端发布" ["intro"]=> string(288) "目录 ECharts 异步加载 ECharts 数据可视化在过去几年中取得了巨大进展。开发人员对可视化产品的期望不再是简单的图表创建工具,而是在交互、性能、数据处理等方面有更高的要求。 chart.setOption({ color: [ " ["username"]=> string(3) "cmt" ["tagsname"]=> string(0) "" ["tagsid"]=> string(2) "[]" ["catesname"]=> string(0) "" ["catesid"]=> string(2) "[]" ["createtime"]=> string(10) "1511396549" ["_id"]=> string(3) "419" } } ["count"]=> int(200) } 222 用FindBugs分析代码漏洞 - 爱码网

  hyddd原创,转载请说明!

  FindBugs是一个专门分析JAVA代码问题的静态代码扫描工具,它是由一位马里兰大学的博士写的,官方网站是:http://findbugs.sourceforge.net/index.html,里面有FindBugs工具的下载,并且也包含了那位博士写的关于静态代码分析引擎的一些论文,不过偶还没看。FindBugs可以发现的问题包括:多线程竞争问题,性能问题,安全问题,代码规范......这些下面我都会详细介绍:>,如果想了解更多关于其他语言的静态代码扫描工具信息,可以参考《[hyddd安全性测试笔记2]浅淡静态代码分析工具》。

一.FindBugs的使用

  先说说FindBugs的使用,FindBugs它提供两种工具形式,一种是界面形式的工具,如下图:

  用FindBugs分析代码漏洞

  另外一种是以Eclipse插件的形式提供的:

  用FindBugs分析代码漏洞

  个人比较喜欢插件的形式,方便~!

  下面简单介绍FindBugs插件的使用:

  1.右键项目Pop Menu->Find Bugs->Find Bugs,如图:

  用FindBugs分析代码漏洞

  2.把FindBugs插件的3个功能WorkSpace导出,如图:

  用FindBugs分析代码漏洞

  (1). Bug Explorer:这里显示的是用FindBugs对这个项目扫描的结果。现在只扫出了一个类型的BUG,同时这个类型的BUG数量为1(见图中括号)。继续打开[DLS]Dead store to local variable,选择其中一项,右键单击,选择Pop Menu中的“Show Bug Details”,我们便会跳转到Bug Details这个WorkSpace。

  用FindBugs分析代码漏洞

  (2).Bug Details:这里是对BUG问题的描述,包括:Bug类别及程度,Bug的定位,对Bug的解释。

  用FindBugs分析代码漏洞

  这里这个Bug类别是Dodgy,程度是中等;双击下面会自动定位BUG的位置;最下面是这个BUG的解释,可以根据里面的提示去修改代码:>

  (3).Bug User Annotations:记录一些自己添加的评注。

二.FindBugs的Bug类型及实例代码:

  FindBugs对BUG的解释在官网有详细的说明:http://findbugs.sourceforge.net/bugDescriptions.html#IS2_INCONSISTENT_SYNC。虽然有说明,但说明一般比较简短,而且没有Demo代码,有时候还真没明白它说什么意思:<,所以在这里我打算整理一下之前看过的资料,把问题和解决方案记录下来

Bad practice:

[Hight]

[H B BC] Random object created and used only once

[Medium]

[M B Nm] Method names should start with a lower case letter

[M B Nm] Class names should start with an upper case letter

[M B ODR] Method may fail to close database resource

[M B DE] Method might ignore exception

Correctness:

[Hight]

[H C FS] More arguments are passed that are actually used in the format string

[H C FS] Format string references missing argument

[H C EC] equals() used to compare array and nonarray

[Medium]

[M C RCN] Nullcheck of value previously dereferenced

[M C NP] Method call passes null for unconditionally dereferenced parameter

[M C NP] Possible null pointer dereference

[M B Eq] Class defines compareTo(...) and uses Object.equals()

Experimental:

[Medium]

[M X OBL] Method may fail to clean up stream or resource 

Internationalization:

......

Malicious code vulnerability:

[Medium]

[M V EI2] May expose internal representation by incorporating reference to mutable object

[M V EI] May expose internal representation by returning reference to mutable object

[M V MS] Public static method may expose internal representation by returning array

Multithreaded correctness:

[Medium]

[M M IS] Inconsistent synchronization

[M M IS] Inconsistent synchronization追加说明


Performance:

[Medium]

[M P Bx] Method invokes inefficient Number constructor; use static valueOf instead

[M P Dm] Method invokes toString() method on a String

[M P UuF] Unused field

Security:

[Medium]

[M S XSS] Servlet reflected cross site scripting vulnerability

Dodgy:  

[Medium]

[M D RCN] Repeated conditional tests

[M D RCN] Redundant nullcheck of value known to be non-null

[M D DLS] Dead store to local variable

[M D REC] Exception is caught when Exception is not thrown

[M D ICAST] Result of integer multiplication cast to long

.......

-----------------------------------------------------------------

三.参考文档

1.http://blog.csdn.net/axzywan/archive/2008/11/16/3312009.aspx

2.http://www.cnitblog.com/weitom1982/archive/2006/03/31/8367.html

3.http://www.ibm.com/developerworks/cn/java/j-jtp06294/

4.http://leewinq.javaeye.com/blog/283813

 

以后慢慢加上去,尽量补全......

我对Java不是太熟悉,可能会有错漏,欢迎交流:>

 

 

相关文章: