Skip to content

Commit 08b551c

Browse files
committed
CC0043, ChangeAnyToAllAnalyzer
1 parent 8846ffb commit 08b551c

File tree

3 files changed

+42
-1
lines changed

3 files changed

+42
-1
lines changed

assets/images/CC0043/codefix0.png

18.9 KB
Loading

diagnostics.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,4 +66,5 @@ tagline: All our diagnostics, ordered by category
6666
## Refactoring
6767

6868
|Diagnostic Id| Name |
69-
|[CC0048](/diagnostics/CC0042.html)|InvertForAnalyzer|
69+
|[CC0048](/diagnostics/CC0042.html)|InvertForAnalyzer|
70+
|[CC0048](/diagnostics/CC0043.html)|ChangeAnyToAllAnalyzer|

diagnostics/CC0043.md

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
---
2+
layout: page
3+
title: CC0043
4+
tagline: ChangeAnyToAllAnalyzer
5+
---
6+
7+
|TypeName|ChangeAnyToAllAnalyzer |
8+
|Check Id | CC0043 |
9+
|Category | Refactoring |
10+
|Severity | Hidden |
11+
12+
# Cause
13+
14+
Changes Any to All or All to Any.
15+
16+
# Example
17+
18+
{% highlight csharp %}
19+
var ints = new[] { 1, 2 }.AsQueryable();
20+
var query = !ints.Any(i => i > 0);
21+
{% endhighlight %}
22+
23+
# Code fix
24+
25+
A code fix will be presented to you that will transform the code, it will change Any to All or All to Any.
26+
27+
{% highlight csharp %}
28+
var ints = new[] { 1, 2 }.AsQueryable();
29+
var query = ints.All(i => i <= 0);
30+
{% endhighlight %}
31+
32+
![Code fix]({{ BASE_PATH }}/assets/images/CC0043/codefix0.png)
33+
34+
# Related rules
35+
36+
TBD
37+
38+
# See also
39+
40+
TBD

0 commit comments

Comments
 (0)