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/annotating-function-parameters-and-return-values.md
+4-4
Original file line number
Diff line number
Diff line change
@@ -284,19 +284,19 @@ This article describes typical uses of annotations for simple function parameter
284
284
285
285
-`_In_reads_to_ptr_(p)`
286
286
287
-
A pointer to an array for which the expression `p`–`_Curr_` (that is, `p` minus `_Curr_`) is defined by the appropriate language standard. The elements prior to `p` must be valid in pre-state.
287
+
A pointer to an array for which the expression `p`-`_Curr_` (that is, `p` minus `_Curr_`) is defined by the appropriate language standard. The elements prior to `p` must be valid in pre-state.
288
288
289
289
-`_In_reads_to_ptr_z_(p)`
290
290
291
-
A pointer to a null-terminated array for which the expression `p`–`_Curr_` (that is, `p` minus `_Curr_`) is defined by the appropriate language standard. The elements prior to `p` must be valid in pre-state.
291
+
A pointer to a null-terminated array for which the expression `p`-`_Curr_` (that is, `p` minus `_Curr_`) is defined by the appropriate language standard. The elements prior to `p` must be valid in pre-state.
292
292
293
293
-`_Out_writes_to_ptr_(p)`
294
294
295
-
A pointer to an array for which the expression `p`–`_Curr_` (that is, `p` minus `_Curr_`) is defined by the appropriate language standard. The elements prior to `p` do not have to be valid in pre-state and must be valid in post-state.
295
+
A pointer to an array for which the expression `p`-`_Curr_` (that is, `p` minus `_Curr_`) is defined by the appropriate language standard. The elements prior to `p` do not have to be valid in pre-state and must be valid in post-state.
296
296
297
297
-`_Out_writes_to_ptr_z_(p)`
298
298
299
-
A pointer to a null-terminated array for which the expression `p`–`_Curr_` (that is, `p` minus `_Curr_`) is defined by the appropriate language standard. The elements prior to `p` do not have to be valid in pre-state and must be valid in post-state.
299
+
A pointer to a null-terminated array for which the expression `p`-`_Curr_` (that is, `p` minus `_Curr_`) is defined by the appropriate language standard. The elements prior to `p` do not have to be valid in pre-state and must be valid in post-state.
300
300
301
301
## Optional Pointer Parameters
302
302
When a pointer parameter annotation includes `_opt_`, it indicates that the parameter may be null. Otherwise, the annotation performs the same as the version that doesn't include `_opt_`. Here is a list of the `_opt_` variants of the pointer parameter annotations:
Copy file name to clipboardexpand all lines: docs/code-quality/c6220.md
+1-1
Original file line number
Diff line number
Diff line change
@@ -38,7 +38,7 @@ warning C6220 - Implicit cast between semantically different integer types: comp
38
38
This warning indicates that an `HRESULT` is being compared with an explicit, non-`HRESULT` value of -1, which is not a well-formed `HRESULT`. A failure in `HRESULT` (`E_FAIL`) is not represented by a -1. Therefore, an implicit cast of an `HRESULT` to an integer will generate an incorrect value and is likely to lead to the wrong result.
39
39
40
40
## Example
41
-
In most cases, this warning is caused by the code mistakenly expecting that a function that should return an `HRESULT` instead returns an integer, by using –1 as a failure value. The following code sample generates this warning:
41
+
In most cases, this warning is caused by the code mistakenly expecting that a function that should return an `HRESULT` instead returns an integer, by using -1 as a failure value. The following code sample generates this warning:
Copy file name to clipboardexpand all lines: docs/code-quality/ca1008-enums-should-have-zero-value.md
+2-2
Original file line number
Diff line number
Diff line change
@@ -47,12 +47,12 @@ translation.priority.mt:
47
47
An enumeration without an applied <xref:System.FlagsAttribute?displayProperty=fullName> does not define a member that has a value of zero; or an enumeration that has an applied <xref:System.FlagsAttribute> defines a member that has a value of zero but its name is not 'None', or the enumeration defines multiple zero-valued members.
48
48
49
49
## Rule Description
50
-
The default value of an uninitialized enumeration, just like other value types, is zero. A non-flags−attributed enumeration should define a member that has the value of zero so that the default value is a valid value of the enumeration. If appropriate, name the member 'None'. Otherwise, assign zero to the most frequently used member. Note that, by default, if the value of the first enumeration member is not set in the declaration, its value is zero.
50
+
The default value of an uninitialized enumeration, just like other value types, is zero. A non-flags-attributed enumeration should define a member that has the value of zero so that the default value is a valid value of the enumeration. If appropriate, name the member 'None'. Otherwise, assign zero to the most frequently used member. Note that, by default, if the value of the first enumeration member is not set in the declaration, its value is zero.
51
51
52
52
If an enumeration that has the <xref:System.FlagsAttribute> applied defines a zero-valued member, its name should be 'None' to indicate that no values have been set in the enumeration. Using a zero-valued member for any other purpose is contrary to the use of the <xref:System.FlagsAttribute> in that the AND and OR bitwise operators are useless with the member. This implies that only one member should be assigned the value zero. Note that if multiple members that have the value zero occur in a flags-attributed enumeration, `Enum.ToString()` returns incorrect results for members that are not zero.
53
53
54
54
## How to Fix Violations
55
-
To fix a violation of this rule for non-flags−attributed enumerations, define a member that has the value of zero; this is a non-breaking change. For flags-attributed enumerations that define a zero-valued member, name this member 'None' and delete any other members that have a value of zero; this is a breaking change.
55
+
To fix a violation of this rule for non-flags-attributed enumerations, define a member that has the value of zero; this is a non-breaking change. For flags-attributed enumerations that define a zero-valued member, name this member 'None' and delete any other members that have a value of zero; this is a breaking change.
56
56
57
57
## When to Suppress Warnings
58
58
Do not suppress a warning from this rule except for flags-attributed enumerations that have previously shipped.
Copy file name to clipboardexpand all lines: docs/code-quality/code-analysis-warnings-for-managed-code-by-checkid.md
+2-2
Original file line number
Diff line number
Diff line change
@@ -455,8 +455,8 @@ The following table lists Code Analysis warnings for managed code by the CheckId
455
455
|CA2123|[CA2123: Override link demands should be identical to base](../code-quality/ca2123-override-link-demands-should-be-identical-to-base.md)|This rule matches a method to its base method, which is either an interface or a virtual method in another type, and then compares the link demands on each. If this rule is violated, a malicious caller can bypass the link demand just by calling the unsecured method.|
456
456
|CA2124|[CA2124: Wrap vulnerable finally clauses in outer try](../code-quality/ca2124-wrap-vulnerable-finally-clauses-in-outer-try.md)|A public or protected method contains a try/finally block. The finally block appears to reset the security state and is not itself enclosed in a finally block.|
457
457
|CA2126|[CA2126: Type link demands require inheritance demands](../code-quality/ca2126-type-link-demands-require-inheritance-demands.md)|A public unsealed type is protected by using a link demand and has an overridable method. Neither the type nor the method is protected by using an inheritance demand.|
458
-
|CA2127|[CA2136: Members should not have conflicting transparency annotations](../code-quality/ca2136-members-should-not-have-conflicting-transparency-annotations.md)|Critical code cannot occur in a 100 percent−transparent assembly. This rule analyzes 100 percent−transparent assemblies for any SecurityCritical annotations at the type, field, and method levels.|
459
-
|CA2128|[CA2147: Transparent methods may not use security asserts](../code-quality/ca2147-transparent-methods-may-not-use-security-asserts.md)|This rule analyzes all methods and types in an assembly that is either 100 percent−transparent or mixed transparent/critical, and flags any declarative or imperative use of Assert.|
458
+
|CA2127|[CA2136: Members should not have conflicting transparency annotations](../code-quality/ca2136-members-should-not-have-conflicting-transparency-annotations.md)|Critical code cannot occur in a 100 percent-transparent assembly. This rule analyzes 100 percent-transparent assemblies for any SecurityCritical annotations at the type, field, and method levels.|
459
+
|CA2128|[CA2147: Transparent methods may not use security asserts](../code-quality/ca2147-transparent-methods-may-not-use-security-asserts.md)|This rule analyzes all methods and types in an assembly that is either 100 percent-transparent or mixed transparent/critical, and flags any declarative or imperative use of Assert.|
460
460
|CA2129|[CA2140: Transparent code must not reference security critical items](../code-quality/ca2140-transparent-code-must-not-reference-security-critical-items.md)|Methods that are marked by SecurityTransparentAttribute call nonpublic members that are marked as SecurityCritical. This rule analyzes all methods and types in an assembly that is mixed transparent/critical, and flags any calls from transparent code to nonpublic critical code that are not marked as SecurityTreatAsSafe.|
461
461
|CA2130|[CA2130: Security critical constants should be transparent](../code-quality/ca2130-security-critical-constants-should-be-transparent.md)|Transparency enforcement is not enforced for constant values because compilers inline constant values so that no lookup is required at run time. Constant fields should be security transparent so that code reviewers do not assume that transparent code cannot access the constant.|
462
462
|CA2131|[CA2131: Security critical types may not participate in type equivalence](../code-quality/ca2131-security-critical-types-may-not-participate-in-type-equivalence.md)|A type participates in type equivalence and either the type itself, or a member or field of the type, is marked by using the SecurityCriticalAttribute attribute. This rule occurs on any critical types or types that contain critical methods or fields that are participating in type equivalence. When the CLR detects such a type, it does not load it with a TypeLoadException at run time. Typically, this rule is raised only when users implement type equivalence manually instead of in by relying on tlbimp and the compilers to do the type equivalence.|
Copy file name to clipboardexpand all lines: docs/code-quality/code-metrics-values.md
+5-5
Original file line number
Diff line number
Diff line change
@@ -39,18 +39,18 @@ Code metrics is a set of software measures that provide developers better insigh
39
39
## Software Measurements
40
40
The following list shows the code metrics results that [!INCLUDE[vsprvs](../code-quality/includes/vsprvs_md.md)] calculates:
41
41
42
-
-**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.
42
+
-**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.
43
43
44
-
-**Cyclomatic Complexity**– Measures the structural complexity of the code. It is created by calculating the number of different code paths in the flow of the program. A program that has complex control flow will require more tests to achieve good code coverage and will be less maintainable.
44
+
-**Cyclomatic Complexity**- Measures the structural complexity of the code. It is created by calculating the number of different code paths in the flow of the program. A program that has complex control flow will require more tests to achieve good code coverage and will be less maintainable.
45
45
46
46
> [!NOTE]
47
47
> In some cases, the calculation of the cyclomatic complexity for a method in [!INCLUDE[vs_dev10_long](../code-quality/includes/vs_dev10_long_md.md)] differs from earlier versions. For more information, see the "Changes in Visual Studio 2010 code complexity calculations section" of [Troubleshooting Code Metrics Issues](../code-quality/troubleshooting-code-metrics-issues.md).
48
48
49
-
-**Depth of Inheritance**– Indicates the number of class definitions that extend to the root of the class hierarchy. The deeper the hierarchy the more difficult it might be to understand where particular methods and fields are defined or/and redefined.
49
+
-**Depth of Inheritance**- Indicates the number of class definitions that extend to the root of the class hierarchy. The deeper the hierarchy the more difficult it might be to understand where particular methods and fields are defined or/and redefined.
50
50
51
-
-**Class Coupling**– Measures the coupling to unique classes through parameters, local variables, return types, method calls, generic or template instantiations, base classes, interface implementations, fields defined on external types, and attribute decoration. Good software design dictates that types and methods should have high cohesion and low coupling. High coupling indicates a design that is difficult to reuse and maintain because of its many interdependencies on other types.
51
+
-**Class Coupling**- Measures the coupling to unique classes through parameters, local variables, return types, method calls, generic or template instantiations, base classes, interface implementations, fields defined on external types, and attribute decoration. Good software design dictates that types and methods should have high cohesion and low coupling. High coupling indicates a design that is difficult to reuse and maintain because of its many interdependencies on other types.
52
52
53
-
-**Lines of Code**– Indicates the approximate number of lines in the code. The count is based on the IL code and is therefore not the exact number of lines in the source code file. A very high count might indicate that a type or method is trying to do too much work and should be split up. It might also indicate that the type or method might be hard to maintain.
53
+
-**Lines of Code**- Indicates the approximate number of lines in the code. The count is based on the IL code and is therefore not the exact number of lines in the source code file. A very high count might indicate that a type or method is trying to do too much work and should be split up. It might also indicate that the type or method might be hard to maintain.
54
54
55
55
## Anonymous Methods
56
56
An *anonymous method* is just a method that has no name. Anonymous methods are most frequently used to pass a code block as a delegate parameter. Metrics results for an anonymous method that is declared in a member, such as a method or accessor, are associated with the member that declares the method. They are not associated with the member that calls the method.
Copy file name to clipboardexpand all lines: docs/cross-platform/getting-started-with-visual-studio-tools-for-unity.md
+2-2
Original file line number
Diff line number
Diff line change
@@ -82,7 +82,7 @@ In this section, you'll learn how to install Visual Studio Tools for Unity and c
82
82
83
83
Otherwise, if you're new to Unity, start small with a basic tutorial. Visit the Unity Learn page to find tutorials on example projects you can start with and lessons you can learn from to build your own game with Unity. The Unity Learn page has easy-to-follow tutorials for several different games.
#### 2 - Configure Unity Editor to use Visual Studio Tools for Unity
88
88
To enable your project to use Visual Studio Tools for Unity, just set Visual Studio as its external script editor. In the Unity Editor, on the main menu, choose **Edit, Preferences**; then, in the **Unity Preferences** dialog, choose **External Tools**. Next, set the **External Script Editor** property to the version of Visual Studio you want to use (Visual Studio Tools for Unity must be installed for this version of Visual Studio) and make sure the **Editor Attaching** property is set.
@@ -104,7 +104,7 @@ In this section, you'll learn how to install Visual Studio Tools for Unity and c
104
104
105
105
Otherwise, if you're new to Unity, start small with a basic tutorial. Visit the Unity Learn page to find tutorials on example projects you can start with and lessons you can learn from to build your own game with Unity. The Unity Learn page has easy-to-follow tutorials for several different games.
#### 2 - Configure Unity Editor to use Visual Studio Tools for Unity
110
110
If you're starting from an existing Unity project or you didn't import the Visual Studio Tools unitypackage when you created the project, you need to import the unitypackage now. In the Unity editor, on the main menu, choose **Assets, Import Package, Visual Studio 2015 Tools** (you should see an option for the version of Visual Studio you have installed).
Copy file name to clipboardexpand all lines: docs/cross-platform/install-and-configure-tools-to-build-using-ios.md
+1-1
Original file line number
Diff line number
Diff line change
@@ -104,7 +104,7 @@ You can use Visual C++ for Cross-Platform Mobile Development to edit, debug and
104
104
During the installation, vcremote is installed and developer mode is activated on your Mac. [Homebrew](http://brew.sh/) and two npm packages, vcremote-lib and vcremote-utils, are also installed.
105
105
106
106
> [!NOTE]
107
-
> To install Homebrew, you must have sudo (administrator) access. If you need to install vcremote without sudo, you can install Homebrew manually in a usr/local location and add its bin folder to your path. For more information, see the [Homebrew documentation](https://github.com/Homebrew/homebrew/wiki/Installation). To manually enable developer mode, enter this command in the Terminal app: `DevToolsSecurity –enable`
107
+
> To install Homebrew, you must have sudo (administrator) access. If you need to install vcremote without sudo, you can install Homebrew manually in a usr/local location and add its bin folder to your path. For more information, see the [Homebrew documentation](https://github.com/Homebrew/homebrew/wiki/Installation). To manually enable developer mode, enter this command in the Terminal app: `DevToolsSecurity -enable`
108
108
109
109
If you update to a new version of Visual Studio, you must update to the current version of the remote agent as well. To update the remote agent, repeat the steps to download and install the remote agent.
0 commit comments