欢迎来到天天文库
浏览记录
ID:40889731
大小:59.78 KB
页数:18页
时间:2019-08-10
《Sonar参数分析》由会员上传分享,免费在线阅读,更多相关内容在行业资料-天天文库。
1、Sonar参数分析APIcompatibility1.APIbehaviorchanges---ClirrPlugin正常接口变化数2.APIbreaks---ClirrPlugin可能引发错误的接口变化3.NewAPI---ClirrPlugin新增接口数4.TotalAPIChanges---ClirrPlugin接口变化总数注:以上参数需要依赖于Clirr,暂时仍存在问题Architecture5.Architecture---TotalQualityPlugin架构质量计算方式:ARCH
2、=100–TITI=TangleIndex6.ArchitectureTangleIndex---TotalQualityPlugin架构复杂指标Complexity7.Complexity—默认复杂度8.Complexity/class—默认类复杂度9.Complexity/file—默认文件复杂度10.Complexity/method—默认方法复杂度11.ComplexityFactor---QualityIndexPlugin复杂度因素计算方式:CF=(5*Complexity>30)*
3、100/(Complexity>1+Complexity>10+Complexity>20+Complexity>30)1.ComplexityFactorMethods---QualityIndexPlugin方法复杂度因素2.QIComplexity---QualityIndexPlugin复杂度质量指标计算方式:(Complexity>30*10+Complexity>20*5+Complexity>10*3+Complexity>1)/validLinesDesign3.DesignCl
4、assesandMethodsComplexity---TotalQualityPluginNOM=(1-(class_complexity-12)/(acel*12))*50+(1-(method_complexity-2.5)/(acel*2.5))*50参见194.DesignCouplingBetweenObjects---TotalQualityPluginCBO=(1-(efferent_coupling-5)/(acel*5))*100参见195.DesignDepthofInhe
5、ritanceTree---TotalQualityPluginDIT=(1-(depth_of_inheritance_tree-5)/(acel*5))*100参见196.DesignLackofCohesionofMethods---TotalQualityPluginLCOM=(1-(lack_of_cohesion_of_method-1)/(acel*1))*100参见197.DesignResponseforClass---TotalQualityPluginRFC=(1-(res
6、ponse_for_class-50)/(acel*50))*100参见198.DesignQuality---TotalQualityPlugin设计质量计算方式:DES=0.15*NOM+0.15*LCOM+0.25*RFC0.25*CBO+0.20*DITNOM=(1-(class_complexity-12)/(acel*12))*50+(1-(method_complexity-2.5)/(acel*2.5))*50LCOM=(1-(lack_of_cohesion_of_method
7、-1)/(acel*1))*100RFC=(1-(response_for_class-50)/(acel*50))*100CBO=(1-(efferent_coupling-5)/(acel*5))*100DIT=(1-(depth_of_inheritance_tree-5)/(acel*5))*100Acel参数因子的值可以在Sonarsetting页面配置。每一个度量标准的默认阙值也可以进行配置(例如,50是response_for_class的默认阈值)。9.LCOM4(Lackofc
8、ohesionofmethods)用来说明class内部方法和变量之间的关系,值越大,说明内聚性越差.一般情况下LCOM4=1是内聚性最佳的.2说明可以拆成两个类,以此类推.但是这种测量对门面服务类来说不适用.有时候很小的类也会根据需要合并在一起,尽管关联不大10.Packagetangleindex包复杂指数此参数为包的复杂等级,最好的值为0%,意味着包之间没有圈依赖;最差的值为100%,意味着包与包之间的关系特别的复杂。该指数的计算公式:2*(package_tangles/package_
此文档下载收益归作者所有