-
-
Notifications
You must be signed in to change notification settings - Fork 260
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0db67f4
commit 4516b18
Showing
39 changed files
with
411 additions
and
90 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
# RCS1242: Do not pass non\-read\-only struct by read\-only reference | ||
|
||
| Property | Value | | ||
| ------------------------ | ----------- | | ||
| Id | RCS1242 | | ||
| Category | Performance | | ||
| Severity | Warning | | ||
| Minimal Language Version | 7\.2 | | ||
|
||
## Example | ||
|
||
### Code with Diagnostic | ||
|
||
```csharp | ||
struct C | ||
{ | ||
void M(in C c) // RCS1242 | ||
{ | ||
} | ||
} | ||
``` | ||
|
||
### Code with Fix | ||
|
||
```csharp | ||
struct C | ||
{ | ||
void M(C c) | ||
{ | ||
} | ||
} | ||
``` | ||
|
||
## See Also | ||
|
||
* [in parameter modifier (C# Reference)](https://docs.microsoft.com/dotnet/csharp/language-reference/keywords/in-parameter-modifier) | ||
* [The 'in'-modifier and the readonly structs in C#](https://devblogs.microsoft.com/premier-developer/the-in-modifier-and-the-readonly-structs-in-c/) | ||
* [How to Suppress a Diagnostic](../HowToConfigureAnalyzers.md#how-to-suppress-a-diagnostic) | ||
|
||
|
||
*\(Generated with [DotMarkdown](http://github.com/JosefPihrt/DotMarkdown)\)* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
# RCS1243: Duplicate word in a comment | ||
|
||
| Property | Value | | ||
| -------- | ------- | | ||
| Id | RCS1243 | | ||
| Category | General | | ||
| Severity | Info | | ||
|
||
## Example | ||
|
||
### Code with Diagnostic | ||
|
||
```csharp | ||
/// <summary> | ||
/// This is the the comment. | ||
/// </summary> | ||
public class C | ||
{ | ||
} | ||
``` | ||
|
||
### Code with Fix | ||
|
||
```csharp | ||
/// <summary> | ||
/// This is the comment. | ||
/// </summary> | ||
public class C | ||
{ | ||
} | ||
``` | ||
|
||
## See Also | ||
|
||
* [How to Suppress a Diagnostic](../HowToConfigureAnalyzers.md#how-to-suppress-a-diagnostic) | ||
|
||
|
||
*\(Generated with [DotMarkdown](http://github.com/JosefPihrt/DotMarkdown)\)* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
# RCS1244: Simplify 'default' expression | ||
|
||
| Property | Value | | ||
| ------------------------ | -------------- | | ||
| Id | RCS1244 | | ||
| Category | Simplification | | ||
| Severity | Hidden | | ||
| Minimal Language Version | 7\.1 | | ||
|
||
## Summary | ||
|
||
This analyzer is similar to [IDE0034](https://docs.microsoft.com/visualstudio/ide/common-quick-actions#remove-type-from-default-value-expression) but there are some differences. For example this analyzer does not simplify 'default' expression passed as an argument expression. | ||
|
||
## Example | ||
|
||
### Code with Diagnostic | ||
|
||
```csharp | ||
Foo M(Foo foo = default(Foo)) RCS1244 | ||
{ | ||
return default(Foo); RCS1244 | ||
} | ||
``` | ||
|
||
### Code with Fix | ||
|
||
```csharp | ||
Foo M(Foo foo = default) | ||
{ | ||
return default; | ||
} | ||
``` | ||
|
||
## See Also | ||
|
||
* [How to Suppress a Diagnostic](../HowToConfigureAnalyzers.md#how-to-suppress-a-diagnostic) | ||
|
||
|
||
*\(Generated with [DotMarkdown](http://github.com/JosefPihrt/DotMarkdown)\)* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
# RCS1245: Simplify conditional expression | ||
|
||
| Property | Value | | ||
| -------- | -------------- | | ||
| Id | RCS1245 | | ||
| Category | Simplification | | ||
| Severity | Hidden | | ||
|
||
## Examples | ||
|
||
### Code with Diagnostic | ||
|
||
```csharp | ||
bool x = y ? false : z; // RCS1245 | ||
``` | ||
|
||
### Code with Fix | ||
|
||
```csharp | ||
bool x = !y && z; | ||
``` | ||
|
||
- - - | ||
|
||
### Code with Diagnostic | ||
|
||
```csharp | ||
bool x = y ? z : true; // RCS1245 | ||
``` | ||
|
||
### Code with Fix | ||
|
||
```csharp | ||
bool x = !y || z; | ||
``` | ||
|
||
## See Also | ||
|
||
* [How to Suppress a Diagnostic](../HowToConfigureAnalyzers.md#how-to-suppress-a-diagnostic) | ||
|
||
|
||
*\(Generated with [DotMarkdown](http://github.com/JosefPihrt/DotMarkdown)\)* |
Oops, something went wrong.