SourceMonitor安装使用
利用SourceMonitor可以为C++、C、C#、Java、Delphi、Visual Basic和HTML的源代码文件测试代码数量和性能。最终结果可以描绘成图、输出打印。peci ty Ini tial CH5 of 6: Specifycheckpoint. The metrics for all of the sourcen checkpointthat you can track the progress of your work. Ifyou wish, you can specify the name of an initialCreatechechpoint so thatOIL as your project 15newcreated, ou will see a display of the files inProrectv Create First Project CheckpointHote: The option to allow parsing of vtF-8 filesapplies to all projects. It can be changed onthe "General tab in the Options dialogThecurrent value is shonn bAllow parsing of UTF-8 files上一步鱼取消帮助七、完成。图示如下:P61ofb: ConfirmProject Nameource Code lanuage: c+tCreateource fi1 e Extensions:*.cyp:术.五,*.iypSour ce Code Direct orD: \code br ancho.2 1LSSource Code Sub-directories: AllProject Egnore Header and Footer Comments: HoProject FilCreate Checkpoint Baseline'Click Finish to create project as specified<上一步)完成取消帮助八、指定本次检査点,默认即可。图示如下:NameFiter: F. cpp, h, hppDem2七月20100me1719Eee□Refresh ListsFiles Not In Nev! Checkpoint[arted by file extension):Files In New Checkpointconfigure计tppInsta‖Per cppautomate cache output 0ranage. CPp=traces Dautom ate cache\output. 1e traces, 1akefile. am∵日CPom4te. cacherequestser hcontig. hinmer. cppMakefile. inonfig. logconfig. statuser. Cppler. hPpHelp九、检测结果。图示如下:LChockpoint h ar o Croat.Filo: Linos Statomont:% Eranchcs Commonts Clas Dofs Metheds/Class ABaselin10.9十、详细统计结果。查看方式双击 Baseline行或右击 Base line行选择 View Checkpoint File图示如下Files :a C++ Pro: ext'Ls', Checkp oint'Baseline'File NameLines Statements% Branches Commente Class Dafs Methodls/Class4101000000.0301740.130040.041420.0544940三000ger. ppgUOh74108200OI0000200Epp0600300000eger. cpp700eger h54[1「.010十一、查看最复杂的文件,这应该是首选准备重构的文件。从大到小排序 Max Complex ity图示如下:File NanLires Stat.,%巳,%C。Ca,JMth, Avg st.Max Complexity Max Detmercpp67237了101时 ver. cpp101672130gent. pp 200 11370.020073暑量构这件、917611310.012.518153.3~‘4了r103700613613.260.06007190.014324练 erol. cpp8457400571456331964神 start. h0000十二、双击此行(上面的 LogManager. cpp行)或右击此行选 Dsplay File Metrics Details.可以看到对此文件的评估。Metrics Details For File Loglanager cpPParameterI valueProject DirectoryD:icodetbrancho.2\Project NameLSCheckpoint NameBaselineFile Name2: ppLIInesStatements156Percent Branch Statements263Percent Lines with Comments109Classes defined0Methods Implemented per Class700Kiviat GraphBlock Histogram(statements vs. depths CommentsHelpMethod:cliNAug Complex彭CopyAug DepthYANg Stmts/Method 20PrntMax De pth Max Complexity345B78g+Done十三、定位最大复杂度的函数。如右击此行上面的 LogManager. cpp行选择 View source file在选 To Most Complex Method即可查看到最大复杂度的函数。图示如下:L:9:C3mn1·x133k比-1[1 Most LoTplesMleltod[1/Cloe改装唤种数版改花球界速那理十四、查看一个文件中所有函数的评估。右击此行(上面的 LogManager. cpp行)选择 D sp lay Method Metrics.图示如下M All Methods in File LoefPrcject Is, Che:hpoint BaseliClass Metho: Name Complexity Statements Maximur Depth Cals1411200十五、查看 KIat Graph。右击此行(上面的 LogManager. cpp行)选择 Display File MetricsKN iat Graph。说明:所有的红星或红加号在绿色区域内符合标准。图示如下:j"'[,圆uk.L、‘卫Kiviat Metrics Graph: Project LSCheckpoint BaselineFile LogManager,卩px Comment[52句Depth[1.0习Avg StmtsMjethod6-10714Depth [3-B1[2最后,就是导出检测结果。选择上面检测结果即 Baseline行点击上面的 Checkpoint工具兰选 Export Checkpoint Detiles(s) as csv.即可。结果用exce打开。图示如下:File Edit ViewCheeWindow Help●的囝回X焖县T+t chnts in proCheckpoint Name Create.Files Lines Statements S Branches% CommBaseline2山u2010433451832
用户评论