You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/code-quality/code-metrics-values.md
+11-4Lines changed: 11 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -7,12 +7,12 @@ ms.suite: ""
7
7
ms.technology: vs-ide-code-analysis
8
8
ms.tgt_pltfrm: ""
9
9
ms.topic: "article"
10
-
helpviewer_keywords:
10
+
helpviewer_keywords:
11
11
- "code metrics [Visual Studio]"
12
12
author: "gewarren"
13
13
ms.author: "gewarren"
14
14
manager: ghogen
15
-
ms.workload:
15
+
ms.workload:
16
16
- "multiple"
17
17
---
18
18
# Code metrics values
@@ -21,9 +21,11 @@ The increased complexity of modern software applications also increases the diff
21
21
22
22
Developers can use Visual Studio to generate code metrics data that measure the complexity and maintainability of their managed code. Code metrics data can be generated for an entire solution or a single project.
23
23
24
+
For information about how to generate code metrics data in Visual Studio, see [How to: Generate code metrics data](../code-quality/how-to-generate-code-metrics-data.md).
25
+
24
26
## Software measurements
25
27
26
-
The following list shows the code metrics results that [!INCLUDE[vsprvs](../code-quality/includes/vsprvs_md.md)] calculates:
28
+
The following list shows the code metrics results that Visual Studio calculates:
27
29
28
30
-**Maintainability Index** - Calculates an index value between 0 and 100 that represents the relative ease of maintaining the code. A high value means better maintainability. Color coded ratings can be used to quickly identify trouble spots in your code. A green rating is between 20 and 100 and indicates that the code has good maintainability. A yellow rating is between 10 and 19 and indicates that the code is moderately maintainable. A red rating is a rating between 0 and 9 and indicates low maintainability.
29
31
@@ -45,4 +47,9 @@ For more information about how Code Metrics treats anonymous methods, see [Anony
45
47
46
48
Some software tools and compilers generate code that is added to a project and that the project developer either does not see or should not change. Mostly, Code Metrics ignores generated code when it calculates the metrics values. This enables the metrics values to reflect what the developer can see and change.
47
49
48
-
Code generated for Windows Forms is not ignored, because it is code that the developer can see and change.
50
+
Code generated for Windows Forms is not ignored, because it is code that the developer can see and change.
51
+
52
+
## Next steps
53
+
54
+
-[How to: Generate code metrics data](../code-quality/how-to-generate-code-metrics-data.md)
55
+
-[Use the Code Metrics Results window](../code-quality/working-with-code-metrics-data.md)
Copy file name to clipboardExpand all lines: docs/code-quality/how-to-enforce-maintainable-code-with-a-code-analysis-check-in-policy.md
+6-6Lines changed: 6 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -16,15 +16,15 @@ manager: ghogen
16
16
ms.workload:
17
17
- "multiple"
18
18
---
19
-
# How to: Enforce Maintainable Code with a Code Analysis Check-in Policy
19
+
# How to: Enforce maintainable code with a code analysis check-in policy
20
20
21
-
Developers can use the Code Metrics tool to measure the complexity and maintainability of their code, but you cannot invoke code metrics as part of a check-in policy. However, you can enable Code Analysis rules that verify the compliance of your code with Code Metrics standards, and enforce the rules through check-in policies. For more information about code metrics, see the [Code Metrics values](../code-quality/code-metrics-values.md).
21
+
Developers can use the Code Metrics tool to measure the complexity and maintainability of their code, but you cannot invoke Code Metrics as part of a check-in policy. However, you can enable Code Analysis rules that verify the compliance of your code with code metrics standards, and enforce the rules through check-in policies. For more information about code metrics, see [Code metrics values](../code-quality/code-metrics-values.md).
22
22
23
23
You can enable the Depth of Inheritance, Class Coupling, Maintainability Index, and Complexity rules to enforce maintainable code through a Code Analysis check-in policy. All four of these rules are found under the "Maintainability Rules" category in the Code Analysis policy editor.
24
24
25
25
Administrators of version control for Team Foundation can add the Code Analysis Maintainability Rules to the check-in policy requirements. These check-in policies require developers to run Code Analysis based on these rule changes before initiating a check-in.
26
26
27
-
## To open the Code Analysis Policy Editor
27
+
## To open the Code Analysis Policy editor
28
28
29
29
1.In **Team Explorer**, right-click the team project, click **Team Project Settings**, and then click **Source Control**.
30
30
@@ -38,7 +38,7 @@ Administrators of version control for Team Foundation can add the Code Analysis
38
38
39
39
The **Code Analysis Policy Editor** dialog box appears.
40
40
41
-
## To enable Code Analysis Maintainability Rules
41
+
## To enable code analysis maintainability rules
42
42
43
43
1.In the **Code Analysis Policy Editor** dialog box, under **Rule Settings**, expand the **Maintainability Rules** node.
44
44
@@ -58,5 +58,5 @@ Administrators of version control for Team Foundation can add the Code Analysis
Copy file name to clipboardExpand all lines: docs/code-quality/working-with-code-metrics-data.md
+10-10Lines changed: 10 additions & 10 deletions
Original file line number
Diff line number
Diff line change
@@ -1,28 +1,28 @@
1
1
---
2
-
title: "Code Metrics Results in Visual Studio | Microsoft Docs"
2
+
title: "The Code Metrics Results window in Visual Studio | Microsoft Docs"
3
3
ms.custom: ""
4
4
ms.date: "12/12/2017"
5
5
ms.reviewer: ""
6
6
ms.suite: ""
7
-
ms.technology:
7
+
ms.technology:
8
8
- "vs-ide-code-analysis"
9
9
ms.tgt_pltfrm: ""
10
10
ms.topic: "article"
11
-
f1_keywords:
11
+
f1_keywords:
12
12
- "vs.codemetrics.output"
13
-
helpviewer_keywords:
13
+
helpviewer_keywords:
14
14
- "code metrics results"
15
15
- "code metrics results window"
16
16
- "results window, code metrics"
17
17
author: "gewarren"
18
18
ms.author: "gewarren"
19
19
manager: ghogen
20
-
ms.workload:
20
+
ms.workload:
21
21
- "multiple"
22
22
---
23
-
# Working with code metrics data
23
+
# Using the Code Metrics Results window
24
24
25
-
The **Code Metrics Results** window displays the data that is generated by the code metrics analysis. For more information about code metrics data values, see [Code Metrics Values](../code-quality/code-metrics-values.md).
25
+
The **Code Metrics Results** window displays the data that is generated by the code metrics analysis. For more information about code metrics data values, see [Code metrics values](../code-quality/code-metrics-values.md).
26
26
27
27
## Displaying code metrics results
28
28
@@ -36,7 +36,7 @@ The **Code Metrics Results** window is displayed automatically when you generate
36
36
37
37
- On the **View** menu, choose **Other Windows** > **Code Metrics Results**.
38
38
39
-
The **Code Metrics Results** window is displayed, even if it contains no results.
39
+
The **Code Metrics Results** window is displayed, even if it contains no results.
40
40
41
41
### To view code metrics details
42
42
@@ -127,5 +127,5 @@ For more information about VSTS work items, see [Work items (VSTS)](/vsts/work/w
0 commit comments