Welcome to MSDN Blogs Sign in | Join | Help

VS 2008 - 如何使用 Code Metrics

使用 Code Metrics 的方法很簡單,在『方案(solution)』或『專案(project)』按右鍵『Calculate Code Metrics』即可,如下圖:

image

分析結果顯示在 Code Metrics Results 視窗中:

image

如上圖所視,這個功能目前計算 5 個指標:Maintainability Index, Cyclomatic Complexity, Depth of Inheritance, Class Coupling, and Lines of Code。這些值的意義稍後會再討論。

 

在結果視窗的上方,可以使用不同的條件來做篩選。若您的專案很大且複雜,可以透過這篩選來縮小想要看的資訊。另外,也貼心的提供匯出到 Excel 的功能。在每個欄位也提供排序的功能,只要按一下每個欄位的標題即可。

 

此功能內建在 Visual Studio 2008 Development 及 Team Suite 版本中。

Published Tuesday, January 22, 2008 1:34 PM by jchiou
Filed under: ,

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS

Comments

No Comments

Leave a Comment

(required) 
required 
(required) 

  
Enter Code Here: Required
 
Page view tracker