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/how-to-enforce-maintainable-code-with-a-code-analysis-check-in-policy.md
+46-46Lines changed: 46 additions & 46 deletions
Original file line number
Diff line number
Diff line change
@@ -4,59 +4,59 @@ ms.custom: ""
4
4
ms.date: "11/04/2016"
5
5
ms.reviewer: ""
6
6
ms.suite: ""
7
-
ms.technology:
8
-
- "vs-ide-code-analysis"
7
+
ms.technology: vs-ide-code-analysis
9
8
ms.tgt_pltfrm: ""
10
9
ms.topic: "article"
11
-
helpviewer_keywords:
10
+
helpviewer_keywords:
12
11
- "code analysis, check-in policies"
13
12
ms.assetid: d1b3b04f-4dd9-40e6-b2d4-b414d33fb647
14
-
caps.latest.revision: 8
15
13
author: "gewarren"
16
14
ms.author: "gewarren"
17
15
manager: ghogen
18
-
ms.workload:
16
+
ms.workload:
19
17
- "multiple"
20
18
---
21
19
# How to: Enforce Maintainable Code with a Code Analysis Check-in Policy
22
-
Developers can use the Code Metrics tool to measure the complexity and maintainability of their code, but they cannot invoke code metrics as part of a check-in policy. However, a team can enable Code Analysis rules that verify the compliance of their 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).
23
-
24
-
Developers can enable the Depth of Inheritance, Class Coupling, Maintainability Index, and Complexity rules to enforce maintainable code through Code Analysis check-in policies. All four of these rules are found under the "Maintainability Rules" category in the Code Analysis policy editor.
25
-
26
-
Administrators of version control for [!INCLUDE[esprfound](../code-quality/includes/esprfound_md.md)] 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.
27
-
28
-
### To open the Code Analysis Policy Editor
29
-
30
-
1. In **Team Explorer**, right-click the team project, click **Team Project Settings**, and then click **Source Control**.
31
-
32
-
The **Source Control** dialog box appears.
33
-
34
-
2. On the **Check-in Policy** tab, and click **Add**.
35
-
36
-
The **Add Check-in Policy** dialog box appears.
37
-
38
-
3. In the **Check-in Policy** list, select the **Code Analysis** check box, and then click **OK**.
39
-
40
-
The **Code Analysis Policy Editor** dialog box appears.
41
-
42
-
### To enable Code Analysis Maintainability Rules
43
-
44
-
1. In the **Code Analysis Policy Editor** dialog box, under **Rule Settings**, expand the **Maintainability Rules** node.
45
-
46
-
2. Select the check boxes for the following rules:
47
-
48
-
- Depth of Inheritance: **CA1501 AvoidExcessiveInheritance** - Threshold: Warning at more than 5 levels deep
49
-
50
-
- Complexity: **CA1502 AvoidExcessiveComplexity** - Threshold: Warning at more than 25
51
-
52
-
- Maintainability Index: **CA1505 AvoidUnmaintainableCode** - Threshold: Warning at fewer than 20
53
-
54
-
- Class Coupling: **CA1506 AvoidExcessiveClassCoupling** - Threshold: Warning at more than 80 for a class and more than 30 for a method
55
-
56
-
- In addition, if you want a rule violation to prevent a build, select the **Treat Warning As An Error** check box next to the rule description.
57
-
58
-
3. Click **OK**. The new check-in policy now applies to future check-ins.
[Creating and Using Code Analysis Check-In Policies](../code-quality/creating-and-using-code-analysis-check-in-policies.md)
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).
22
+
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
+
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
+
27
+
## To open the Code Analysis Policy Editor
28
+
29
+
1.In **Team Explorer**, right-click the team project, click **Team Project Settings**, and then click **Source Control**.
30
+
31
+
The **Source Control** dialog box appears.
32
+
33
+
2.On the **Check-in Policy** tab, and click **Add**.
34
+
35
+
The **Add Check-in Policy** dialog box appears.
36
+
37
+
3.In the **Check-in Policy** list, select the **Code Analysis** check box, and then click **OK**.
38
+
39
+
The **Code Analysis Policy Editor** dialog box appears.
40
+
41
+
## To enable Code Analysis Maintainability Rules
42
+
43
+
1.In the **Code Analysis Policy Editor** dialog box, under **Rule Settings**, expand the **Maintainability Rules** node.
44
+
45
+
2.Select the check boxes for the following rules:
46
+
47
+
- Depth of Inheritance: **CA1501 AvoidExcessiveInheritance** - Threshold: Warning at more than 5 levels deep
48
+
49
+
- Complexity: **CA1502 AvoidExcessiveComplexity** - Threshold: Warning at more than 25
50
+
51
+
- Maintainability Index: **CA1505 AvoidUnmaintainableCode** - Threshold: Warning at fewer than 20
52
+
53
+
- Class Coupling: **CA1506 AvoidExcessiveClassCoupling** - Threshold: Warning at more than 80 for a class and more than 30 for a method
54
+
55
+
In addition, if you want a rule violation to prevent a successful build, select the **Treat Warning As An Error** check box next to the rule description.
56
+
57
+
3.Click **OK**. The new check-in policy now applies to future check-ins.
Copy file name to clipboardExpand all lines: docs/cross-platform/cross-platform-mobile-development-in-visual-studio.md
+8-20Lines changed: 8 additions & 20 deletions
Original file line number
Diff line number
Diff line change
@@ -15,39 +15,27 @@ manager: ghogen
15
15
ms.workload:
16
16
- "multiple"
17
17
---
18
-
# Cross-Platform Mobile Development in Visual Studio
19
-
You can build apps for Android, iOS, and Windows devices by using Visual Studio. As you design your app, use tools in Visual Studio to easily add connected services such as Office 365, Azure App Service, and Application Insights.
20
-
21
-
Build your apps by using C# and the .NET Framework, HTML and JavaScript, or C++. Share code, strings, images, and in some cases even the user interface.
22
-
23
-
If you want to build a game or immersive graphical app, install Visual Studio tools for Unity and enjoy all of the powerful productivity features of Visual Studio with Unity, the popular cross-platform game/graphics engine and development environment for apps that run on iOS, Android, Windows, and other platforms.
24
-
25
-
**In this article:**
18
+
# Cross-Platform mobile development in Visual Studio
26
19
27
-
-[Build an app for Android, iOS, and Windows (.NET Framework)](#NET)
28
-
29
-
-[Target Android, iOS, and Windows from a single code base](../cross-platform/cross-platform-mobile-development-in-visual-studio.md#AndroidHTML)
30
-
31
-
-[Target Windows 10 devices](../cross-platform/cross-platform-mobile-development-in-visual-studio.md#WindowsHTML)
20
+
You can build apps for Android, iOS, and Windows devices by using Visual Studio. As you design your app, use tools in Visual Studio to easily add connected services such as Office 365, Azure App Service, and Application Insights.
32
21
33
-
-[Build an app for Android, iOS, and Windows (HTML/JavaScript)](#HTML)
22
+
Build your apps by using C# and the .NET Framework, HTML and JavaScript, or C++. Share code, strings, images, and in some cases even the user interface.
34
23
35
-
-[Build an appfor Android and Windows (C++)](#CPP)
24
+
If you want to build a game or immersive graphical app, install Visual Studio tools for Unity and enjoy all of the powerful productivity features of Visual Studio with Unity, the popular cross-platform game/graphics engine and development environment for apps that run on iOS, Android, Windows, and other platforms.
36
25
37
-
-[Build a cross-platform game for Android, iOS, and Windows by using Visual Studio tools for Unity](#Unity)
26
+
## Build an app for Android, iOS, and Windows (.NET Framework)
38
27
39
-
## <aname="NET"></a> Build an app for Android, iOS, and Windows (.NET Framework)
0 commit comments