-
Notifications
You must be signed in to change notification settings - Fork 466
/
Microsoft.CodeAnalysis.NetAnalyzers.sarif
5466 lines (5466 loc) · 244 KB
/
Microsoft.CodeAnalysis.NetAnalyzers.sarif
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
{
"$schema": "http://json.schemastore.org/sarif-1.0.0",
"version": "1.0.0",
"runs": [
{
"tool": {
"name": "Microsoft.CodeAnalysis.CSharp.NetAnalyzers",
"version": "5.0.4",
"language": "en-US"
},
"rules": {
"CA1001": {
"id": "CA1001",
"shortDescription": "Types that own disposable fields should be disposable",
"fullDescription": "A class declares and implements an instance field that is a System.IDisposable type, and the class does not implement IDisposable. A class that declares an IDisposable field indirectly owns an unmanaged resource and should implement the IDisposable interface.",
"defaultLevel": "hidden",
"helpUri": "https://docs.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1001",
"properties": {
"category": "Design",
"isEnabledByDefault": true,
"typeName": "CSharpTypesThatOwnDisposableFieldsShouldBeDisposableAnalyzer",
"languages": [
"C#"
],
"tags": [
"PortedFromFxCop",
"Telemetry",
"EnabledRuleInAggressiveMode"
]
}
},
"CA1032": {
"id": "CA1032",
"shortDescription": "Implement standard exception constructors",
"fullDescription": "Failure to provide the full set of constructors can make it difficult to correctly handle exceptions.",
"defaultLevel": "warning",
"helpUri": "https://docs.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1032",
"properties": {
"category": "Design",
"isEnabledByDefault": false,
"typeName": "CSharpImplementStandardExceptionConstructorsAnalyzer",
"languages": [
"C#"
],
"tags": [
"PortedFromFxCop",
"Telemetry",
"EnabledRuleInAggressiveMode"
]
}
},
"CA1200": {
"id": "CA1200",
"shortDescription": "Avoid using cref tags with a prefix",
"fullDescription": "Use of cref tags with prefixes should be avoided, since it prevents the compiler from verifying references and the IDE from updating references during refactorings. It is permissible to suppress this error at a single documentation site if the cref must use a prefix because the type being mentioned is not findable by the compiler. For example, if a cref is mentioning a special attribute in the full framework but you're in a file that compiles against the portable framework, or if you want to reference a type at higher layer of Roslyn, you should suppress the error. You should not suppress the error just because you want to take a shortcut and avoid using the full syntax.",
"defaultLevel": "hidden",
"helpUri": "https://docs.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1200",
"properties": {
"category": "Documentation",
"isEnabledByDefault": true,
"typeName": "CSharpAvoidUsingCrefTagsWithAPrefixAnalyzer",
"languages": [
"C#"
],
"tags": [
"Telemetry",
"EnabledRuleInAggressiveMode"
]
}
},
"CA1309": {
"id": "CA1309",
"shortDescription": "Use ordinal string comparison",
"fullDescription": "A string comparison operation that is nonlinguistic does not set the StringComparison parameter to either Ordinal or OrdinalIgnoreCase. By explicitly setting the parameter to either StringComparison.Ordinal or StringComparison.OrdinalIgnoreCase, your code often gains speed, becomes more correct, and becomes more reliable.",
"defaultLevel": "hidden",
"helpUri": "https://docs.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1309",
"properties": {
"category": "Globalization",
"isEnabledByDefault": true,
"typeName": "CSharpUseOrdinalStringComparisonAnalyzer",
"languages": [
"C#"
],
"tags": [
"PortedFromFxCop",
"Telemetry",
"EnabledRuleInAggressiveMode"
]
}
},
"CA1507": {
"id": "CA1507",
"shortDescription": "Use nameof to express symbol names",
"fullDescription": "Using nameof helps keep your code valid when refactoring.",
"defaultLevel": "note",
"helpUri": "https://docs.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1507",
"properties": {
"category": "Maintainability",
"isEnabledByDefault": true,
"typeName": "CSharpUseNameofInPlaceOfStringAnalyzer",
"languages": [
"C#"
],
"tags": [
"Telemetry",
"EnabledRuleInAggressiveMode"
]
}
},
"CA1801": {
"id": "CA1801",
"shortDescription": "Review unused parameters",
"fullDescription": "Avoid unused paramereters in your code. If the parameter cannot be removed, then change its name so it starts with an underscore and is optionally followed by an integer, such as '_', '_1', '_2', etc. These are treated as special discard symbol names.",
"defaultLevel": "warning",
"helpUri": "https://docs.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1801",
"properties": {
"category": "Usage",
"isEnabledByDefault": false,
"typeName": "CSharpReviewUnusedParametersAnalyzer",
"languages": [
"C#"
],
"tags": [
"PortedFromFxCop",
"Telemetry",
"EnabledRuleInAggressiveMode"
]
}
},
"CA1805": {
"id": "CA1805",
"shortDescription": "Do not initialize unnecessarily",
"fullDescription": "The .NET runtime initializes all fields of reference types to their default values before running the constructor. In most cases, explicitly initializing a field to its default value in a constructor is redundant, adding maintenance costs and potentially degrading performance (such as with increased assembly size), and the explicit initialization can be removed. In some cases, such as with static readonly fields that permanently retain their default value, consider instead changing them to be constants or properties.",
"defaultLevel": "hidden",
"helpUri": "https://docs.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1805",
"properties": {
"category": "Performance",
"isEnabledByDefault": true,
"typeName": "CSharpDoNotInitializeUnnecessarilyAnalyzer",
"languages": [
"C#"
],
"tags": [
"PortedFromFxCop",
"Telemetry",
"EnabledRuleInAggressiveMode"
]
}
},
"CA1812": {
"id": "CA1812",
"shortDescription": "Avoid uninstantiated internal classes",
"fullDescription": "An instance of an assembly-level type is not created by code in the assembly.",
"defaultLevel": "warning",
"helpUri": "https://docs.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1812",
"properties": {
"category": "Performance",
"isEnabledByDefault": false,
"typeName": "CSharpAvoidUninstantiatedInternalClasses",
"languages": [
"C#"
],
"tags": [
"PortedFromFxCop",
"Telemetry",
"EnabledRuleInAggressiveMode",
"CompilationEnd"
]
}
},
"CA1824": {
"id": "CA1824",
"shortDescription": "Mark assemblies with NeutralResourcesLanguageAttribute",
"fullDescription": "The NeutralResourcesLanguage attribute informs the ResourceManager of the language that was used to display the resources of a neutral culture for an assembly. This improves lookup performance for the first resource that you load and can reduce your working set.",
"defaultLevel": "note",
"helpUri": "https://docs.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1824",
"properties": {
"category": "Performance",
"isEnabledByDefault": true,
"typeName": "CSharpMarkAssembliesWithNeutralResourcesLanguageAnalyzer",
"languages": [
"C#"
],
"tags": [
"PortedFromFxCop",
"Telemetry",
"EnabledRuleInAggressiveMode",
"CompilationEnd"
]
}
},
"CA1825": {
"id": "CA1825",
"shortDescription": "Avoid zero-length array allocations",
"fullDescription": "Avoid unnecessary zero-length array allocations. Use {0} instead.",
"defaultLevel": "note",
"helpUri": "https://docs.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1825",
"properties": {
"category": "Performance",
"isEnabledByDefault": true,
"typeName": "CSharpAvoidZeroLengthArrayAllocationsAnalyzer",
"languages": [
"C#"
],
"tags": [
"Telemetry",
"EnabledRuleInAggressiveMode"
]
}
},
"CA2014": {
"id": "CA2014",
"shortDescription": "Do not use stackalloc in loops",
"fullDescription": "Stack space allocated by a stackalloc is only released at the end of the current method's invocation. Using it in a loop can result in unbounded stack growth and eventual stack overflow conditions.",
"defaultLevel": "warning",
"helpUri": "https://docs.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca2014",
"properties": {
"category": "Reliability",
"isEnabledByDefault": true,
"typeName": "CSharpDoNotUseStackallocInLoopsAnalyzer",
"languages": [
"C#"
],
"tags": [
"Telemetry",
"EnabledRuleInAggressiveMode"
]
}
},
"CA2016": {
"id": "CA2016",
"shortDescription": "Forward the 'CancellationToken' parameter to methods",
"fullDescription": "Forward the 'CancellationToken' parameter to methods to ensure the operation cancellation notifications gets properly propagated, or pass in 'CancellationToken.None' explicitly to indicate intentionally not propagating the token.",
"defaultLevel": "note",
"helpUri": "https://docs.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca2016",
"properties": {
"category": "Reliability",
"isEnabledByDefault": true,
"typeName": "CSharpForwardCancellationTokenToInvocationsAnalyzer",
"languages": [
"C#"
],
"tags": [
"Telemetry",
"EnabledRuleInAggressiveMode"
]
}
},
"CA2234": {
"id": "CA2234",
"shortDescription": "Pass system uri objects instead of strings",
"fullDescription": "A call is made to a method that has a string parameter whose name contains \"uri\", \"URI\", \"urn\", \"URN\", \"url\", or \"URL\". The declaring type of the method contains a corresponding method overload that has a System.Uri parameter.",
"defaultLevel": "warning",
"helpUri": "https://docs.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca2234",
"properties": {
"category": "Usage",
"isEnabledByDefault": false,
"typeName": "CSharpPassSystemUriObjectsInsteadOfStringsAnalyzer",
"languages": [
"C#"
],
"tags": [
"PortedFromFxCop",
"Telemetry",
"EnabledRuleInAggressiveMode"
]
}
},
"CA2352": {
"id": "CA2352",
"shortDescription": "Unsafe DataSet or DataTable in serializable type can be vulnerable to remote code execution attacks",
"fullDescription": "When deserializing untrusted input with an IFormatter-based serializer, deserializing a {0} object is insecure. '{1}' either is or derives from {0}.",
"defaultLevel": "warning",
"helpUri": "https://docs.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca2352",
"properties": {
"category": "Security",
"isEnabledByDefault": false,
"typeName": "CSharpDataSetDataTableInSerializableTypeAnalyzer",
"languages": [
"C#"
],
"tags": [
"Telemetry",
"EnabledRuleInAggressiveMode"
]
}
},
"CA2353": {
"id": "CA2353",
"shortDescription": "Unsafe DataSet or DataTable in serializable type",
"fullDescription": "When deserializing untrusted input, deserializing a {0} object is insecure. '{1}' either is or derives from {0}",
"defaultLevel": "warning",
"helpUri": "https://docs.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca2353",
"properties": {
"category": "Security",
"isEnabledByDefault": false,
"typeName": "CSharpDataSetDataTableInSerializableTypeAnalyzer",
"languages": [
"C#"
],
"tags": [
"Telemetry",
"EnabledRuleInAggressiveMode"
]
}
},
"CA2354": {
"id": "CA2354",
"shortDescription": "Unsafe DataSet or DataTable in deserialized object graph can be vulnerable to remote code execution attacks",
"fullDescription": "When deserializing untrusted input, deserializing a {0} object is insecure. '{1}' either is or derives from {0}",
"defaultLevel": "warning",
"helpUri": "https://docs.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca2354",
"properties": {
"category": "Security",
"isEnabledByDefault": false,
"typeName": "CSharpDataSetDataTableInIFormatterSerializableObjectGraphAnalyzer",
"languages": [
"C#"
],
"tags": [
"Telemetry",
"EnabledRuleInAggressiveMode"
]
}
},
"CA2355": {
"id": "CA2355",
"shortDescription": "Unsafe DataSet or DataTable type found in deserializable object graph",
"fullDescription": "When deserializing untrusted input, deserializing a {0} object is insecure. '{1}' either is or derives from {0}",
"defaultLevel": "warning",
"helpUri": "https://docs.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca2355",
"properties": {
"category": "Security",
"isEnabledByDefault": false,
"typeName": "CSharpDataSetDataTableInSerializableObjectGraphAnalyzer",
"languages": [
"C#"
],
"tags": [
"Telemetry",
"EnabledRuleInAggressiveMode"
]
}
},
"CA2356": {
"id": "CA2356",
"shortDescription": "Unsafe DataSet or DataTable type in web deserializable object graph",
"fullDescription": "When deserializing untrusted input, deserializing a {0} object is insecure. '{1}' either is or derives from {0}",
"defaultLevel": "warning",
"helpUri": "https://docs.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca2356",
"properties": {
"category": "Security",
"isEnabledByDefault": false,
"typeName": "CSharpDataSetDataTableInWebSerializableObjectGraphAnalyzer",
"languages": [
"C#"
],
"tags": [
"Telemetry",
"EnabledRuleInAggressiveMode"
]
}
},
"CA2362": {
"id": "CA2362",
"shortDescription": "Unsafe DataSet or DataTable in auto-generated serializable type can be vulnerable to remote code execution attacks",
"fullDescription": "When deserializing untrusted input with an IFormatter-based serializer, deserializing a {0} object is insecure. '{1}' either is or derives from {0}. Ensure that the auto-generated type is never deserialized with untrusted data.",
"defaultLevel": "warning",
"helpUri": "https://docs.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca2362",
"properties": {
"category": "Security",
"isEnabledByDefault": false,
"typeName": "CSharpDataSetDataTableInSerializableTypeAnalyzer",
"languages": [
"C#"
],
"tags": [
"Telemetry",
"EnabledRuleInAggressiveMode"
]
}
}
}
},
{
"tool": {
"name": "Microsoft.CodeAnalysis.NetAnalyzers",
"version": "5.0.4",
"language": "en-US"
},
"rules": {
"CA1000": {
"id": "CA1000",
"shortDescription": "Do not declare static members on generic types",
"fullDescription": "When a static member of a generic type is called, the type argument must be specified for the type. When a generic instance member that does not support inference is called, the type argument must be specified for the member. In these two cases, the syntax for specifying the type argument is different and easily confused.",
"defaultLevel": "hidden",
"helpUri": "https://docs.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1000",
"properties": {
"category": "Design",
"isEnabledByDefault": true,
"typeName": "DoNotDeclareStaticMembersOnGenericTypesAnalyzer",
"languages": [
"C#",
"Visual Basic"
],
"tags": [
"PortedFromFxCop",
"Telemetry",
"EnabledRuleInAggressiveMode"
]
}
},
"CA1002": {
"id": "CA1002",
"shortDescription": "Do not expose generic lists",
"fullDescription": "System.Collections.Generic.List<T> is a generic collection that's designed for performance and not inheritance. List<T> does not contain virtual members that make it easier to change the behavior of an inherited class.",
"defaultLevel": "warning",
"helpUri": "https://docs.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1002",
"properties": {
"category": "Design",
"isEnabledByDefault": false,
"typeName": "DoNotExposeGenericLists",
"languages": [
"C#",
"Visual Basic"
],
"tags": [
"PortedFromFxCop",
"Telemetry",
"EnabledRuleInAggressiveMode"
]
}
},
"CA1003": {
"id": "CA1003",
"shortDescription": "Use generic event handler instances",
"fullDescription": "A type contains an event that declares an EventHandler delegate that returns void, whose signature contains two parameters (the first an object and the second a type that is assignable to EventArgs), and the containing assembly targets Microsoft .NET Framework?2.0.",
"defaultLevel": "warning",
"helpUri": "https://docs.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1003",
"properties": {
"category": "Design",
"isEnabledByDefault": false,
"typeName": "UseGenericEventHandlerInstancesAnalyzer",
"languages": [
"C#",
"Visual Basic"
],
"tags": [
"PortedFromFxCop",
"Telemetry",
"EnabledRuleInAggressiveMode"
]
}
},
"CA1005": {
"id": "CA1005",
"shortDescription": "Avoid excessive parameters on generic types",
"fullDescription": "The more type parameters a generic type contains, the more difficult it is to know and remember what each type parameter represents.",
"defaultLevel": "warning",
"helpUri": "https://docs.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1005",
"properties": {
"category": "Design",
"isEnabledByDefault": false,
"typeName": "AvoidExcessiveParametersOnGenericTypes",
"languages": [
"C#",
"Visual Basic"
],
"tags": [
"PortedFromFxCop",
"Telemetry"
]
}
},
"CA1008": {
"id": "CA1008",
"shortDescription": "Enums should have zero value",
"fullDescription": "The default value of an uninitialized enumeration, just as other value types, is zero. A nonflags-attributed enumeration should define a member by using the value of zero so that the default value is a valid value of the enumeration. If an enumeration that has the FlagsAttribute attribute applied defines a zero-valued member, its name should be \"\"None\"\" to indicate that no values have been set in the enumeration.",
"defaultLevel": "warning",
"helpUri": "https://docs.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1008",
"properties": {
"category": "Design",
"isEnabledByDefault": false,
"typeName": "EnumsShouldHaveZeroValueAnalyzer",
"languages": [
"C#",
"Visual Basic"
],
"tags": [
"PortedFromFxCop",
"Telemetry",
"EnabledRuleInAggressiveMode",
"RuleNoZero"
]
}
},
"CA1010": {
"id": "CA1010",
"shortDescription": "Generic interface should also be implemented",
"fullDescription": "To broaden the usability of a type, implement one of the generic interfaces. This is especially true for collections as they can then be used to populate generic collection types.",
"defaultLevel": "hidden",
"helpUri": "https://docs.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1010",
"properties": {
"category": "Design",
"isEnabledByDefault": true,
"typeName": "CollectionsShouldImplementGenericInterfaceAnalyzer",
"languages": [
"C#",
"Visual Basic"
],
"tags": [
"PortedFromFxCop",
"Telemetry",
"EnabledRuleInAggressiveMode"
]
}
},
"CA1012": {
"id": "CA1012",
"shortDescription": "Abstract types should not have public constructors",
"fullDescription": "Constructors on abstract types can be called only by derived types. Because public constructors create instances of a type, and you cannot create instances of an abstract type, an abstract type that has a public constructor is incorrectly designed.",
"defaultLevel": "warning",
"helpUri": "https://docs.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1012",
"properties": {
"category": "Design",
"isEnabledByDefault": false,
"typeName": "AbstractTypesShouldNotHaveConstructorsAnalyzer",
"languages": [
"C#",
"Visual Basic"
],
"tags": [
"PortedFromFxCop",
"Telemetry",
"EnabledRuleInAggressiveMode"
]
}
},
"CA1014": {
"id": "CA1014",
"shortDescription": "Mark assemblies with CLSCompliant",
"fullDescription": "The Common Language Specification (CLS) defines naming restrictions, data types, and rules to which assemblies must conform if they will be used across programming languages. Good design dictates that all assemblies explicitly indicate CLS compliance by using CLSCompliantAttribute . If this attribute is not present on an assembly, the assembly is not compliant.",
"defaultLevel": "warning",
"helpUri": "https://docs.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1014",
"properties": {
"category": "Design",
"isEnabledByDefault": false,
"typeName": "MarkAssembliesWithAttributesDiagnosticAnalyzer",
"languages": [
"C#",
"Visual Basic"
],
"tags": [
"PortedFromFxCop",
"Telemetry",
"EnabledRuleInAggressiveMode",
"CompilationEnd"
]
}
},
"CA1016": {
"id": "CA1016",
"shortDescription": "Mark assemblies with assembly version",
"fullDescription": "The .NET Framework uses the version number to uniquely identify an assembly, and to bind to types in strongly named assemblies. The version number is used together with version and publisher policy. By default, applications run only with the assembly version with which they were built.",
"defaultLevel": "note",
"helpUri": "https://docs.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1016",
"properties": {
"category": "Design",
"isEnabledByDefault": true,
"typeName": "MarkAssembliesWithAttributesDiagnosticAnalyzer",
"languages": [
"C#",
"Visual Basic"
],
"tags": [
"PortedFromFxCop",
"Telemetry",
"EnabledRuleInAggressiveMode",
"CompilationEnd"
]
}
},
"CA1017": {
"id": "CA1017",
"shortDescription": "Mark assemblies with ComVisible",
"fullDescription": "ComVisibleAttribute determines how COM clients access managed code. Good design dictates that assemblies explicitly indicate COM visibility. COM visibility can be set for the whole assembly and then overridden for individual types and type members. If this attribute is not present, the contents of the assembly are visible to COM clients.",
"defaultLevel": "warning",
"helpUri": "https://docs.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1017",
"properties": {
"category": "Design",
"isEnabledByDefault": false,
"typeName": "MarkAssembliesWithComVisibleAnalyzer",
"languages": [
"C#",
"Visual Basic"
],
"tags": [
"PortedFromFxCop",
"Telemetry",
"CompilationEnd"
]
}
},
"CA1018": {
"id": "CA1018",
"shortDescription": "Mark attributes with AttributeUsageAttribute",
"fullDescription": "Specify AttributeUsage on {0}",
"defaultLevel": "note",
"helpUri": "https://docs.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1018",
"properties": {
"category": "Design",
"isEnabledByDefault": true,
"typeName": "MarkAttributesWithAttributeUsageAnalyzer",
"languages": [
"C#",
"Visual Basic"
],
"tags": [
"PortedFromFxCop",
"Telemetry",
"EnabledRuleInAggressiveMode"
]
}
},
"CA1019": {
"id": "CA1019",
"shortDescription": "Define accessors for attribute arguments",
"fullDescription": "Remove the property setter from {0} or reduce its accessibility because it corresponds to positional argument {1}",
"defaultLevel": "warning",
"helpUri": "https://docs.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1019",
"properties": {
"category": "Design",
"isEnabledByDefault": false,
"typeName": "DefineAccessorsForAttributeArgumentsAnalyzer",
"languages": [
"C#",
"Visual Basic"
],
"tags": [
"PortedFromFxCop",
"Telemetry",
"EnabledRuleInAggressiveMode"
]
}
},
"CA1021": {
"id": "CA1021",
"shortDescription": "Avoid out parameters",
"fullDescription": "Passing types by reference (using 'out' or 'ref') requires experience with pointers, understanding how value types and reference types differ, and handling methods with multiple return values. Also, the difference between 'out' and 'ref' parameters is not widely understood.",
"defaultLevel": "warning",
"helpUri": "https://docs.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1021",
"properties": {
"category": "Design",
"isEnabledByDefault": false,
"typeName": "AvoidOutParameters",
"languages": [
"C#",
"Visual Basic"
],
"tags": [
"PortedFromFxCop",
"Telemetry"
]
}
},
"CA1024": {
"id": "CA1024",
"shortDescription": "Use properties where appropriate",
"fullDescription": "A public or protected method has a name that starts with \"\"Get\"\", takes no parameters, and returns a value that is not an array. The method might be a good candidate to become a property.",
"defaultLevel": "warning",
"helpUri": "https://docs.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1024",
"properties": {
"category": "Design",
"isEnabledByDefault": false,
"typeName": "UsePropertiesWhereAppropriateAnalyzer",
"languages": [
"C#",
"Visual Basic"
],
"tags": [
"PortedFromFxCop",
"Telemetry",
"EnabledRuleInAggressiveMode"
]
}
},
"CA1027": {
"id": "CA1027",
"shortDescription": "Mark enums with FlagsAttribute",
"fullDescription": "An enumeration is a value type that defines a set of related named constants. Apply FlagsAttribute to an enumeration when its named constants can be meaningfully combined.",
"defaultLevel": "warning",
"helpUri": "https://docs.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1027",
"properties": {
"category": "Design",
"isEnabledByDefault": false,
"typeName": "EnumWithFlagsAttributeAnalyzer",
"languages": [
"C#",
"Visual Basic"
],
"tags": [
"PortedFromFxCop",
"Telemetry",
"EnabledRuleInAggressiveMode"
]
}
},
"CA1028": {
"id": "CA1028",
"shortDescription": "Enum Storage should be Int32",
"fullDescription": "An enumeration is a value type that defines a set of related named constants. By default, the System.Int32 data type is used to store the constant value. Although you can change this underlying type, it is not required or recommended for most scenarios.",
"defaultLevel": "warning",
"helpUri": "https://docs.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1028",
"properties": {
"category": "Design",
"isEnabledByDefault": false,
"typeName": "EnumStorageShouldBeInt32Analyzer",
"languages": [
"C#",
"Visual Basic"
],
"tags": [
"PortedFromFxCop",
"Telemetry",
"EnabledRuleInAggressiveMode"
]
}
},
"CA1030": {
"id": "CA1030",
"shortDescription": "Use events where appropriate",
"fullDescription": "This rule detects methods that have names that ordinarily would be used for events. If a method is called in response to a clearly defined state change, the method should be invoked by an event handler. Objects that call the method should raise events instead of calling the method directly.",
"defaultLevel": "warning",
"helpUri": "https://docs.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1030",
"properties": {
"category": "Design",
"isEnabledByDefault": false,
"typeName": "UseEventsWhereAppropriateAnalyzer",
"languages": [
"C#",
"Visual Basic"
],
"tags": [
"PortedFromFxCop",
"Telemetry",
"EnabledRuleInAggressiveMode"
]
}
},
"CA1031": {
"id": "CA1031",
"shortDescription": "Do not catch general exception types",
"fullDescription": "A general exception such as System.Exception or System.SystemException or a disallowed exception type is caught in a catch statement, or a general catch clause is used. General and disallowed exceptions should not be caught.",
"defaultLevel": "warning",
"helpUri": "https://docs.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1031",
"properties": {
"category": "Design",
"isEnabledByDefault": false,
"typeName": "DoNotCatchGeneralExceptionTypesAnalyzer",
"languages": [
"C#",
"Visual Basic"
],
"tags": [
"PortedFromFxCop",
"Telemetry",
"EnabledRuleInAggressiveMode"
]
}
},
"CA1033": {
"id": "CA1033",
"shortDescription": "Interface methods should be callable by child types",
"fullDescription": "An unsealed externally visible type provides an explicit method implementation of a public interface and does not provide an alternative externally visible method that has the same name.",
"defaultLevel": "warning",
"helpUri": "https://docs.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1033",
"properties": {
"category": "Design",
"isEnabledByDefault": false,
"typeName": "InterfaceMethodsShouldBeCallableByChildTypesAnalyzer",
"languages": [
"C#",
"Visual Basic"
],
"tags": [
"PortedFromFxCop",
"Telemetry",
"EnabledRuleInAggressiveMode"
]
}
},
"CA1034": {
"id": "CA1034",
"shortDescription": "Nested types should not be visible",
"fullDescription": "A nested type is a type that is declared in the scope of another type. Nested types are useful to encapsulate private implementation details of the containing type. Used for this purpose, nested types should not be externally visible.",
"defaultLevel": "warning",
"helpUri": "https://docs.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1034",
"properties": {
"category": "Design",
"isEnabledByDefault": false,
"typeName": "NestedTypesShouldNotBeVisibleAnalyzer",
"languages": [
"C#",
"Visual Basic"
],
"tags": [
"PortedFromFxCop",
"Telemetry",
"EnabledRuleInAggressiveMode"
]
}
},
"CA1036": {
"id": "CA1036",
"shortDescription": "Override methods on comparable types",
"fullDescription": "A public or protected type implements the System.IComparable interface. It does not override Object.Equals nor does it overload the language-specific operator for equality, inequality, less than, less than or equal, greater than or greater than or equal.",
"defaultLevel": "hidden",
"helpUri": "https://docs.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1036",
"properties": {
"category": "Design",
"isEnabledByDefault": true,
"typeName": "OverrideMethodsOnComparableTypesAnalyzer",
"languages": [
"C#",
"Visual Basic"
],
"tags": [
"PortedFromFxCop",
"Telemetry",
"EnabledRuleInAggressiveMode"
]
}
},
"CA1040": {
"id": "CA1040",
"shortDescription": "Avoid empty interfaces",
"fullDescription": "Interfaces define members that provide a behavior or usage contract. The functionality that is described by the interface can be adopted by any type, regardless of where the type appears in the inheritance hierarchy. A type implements an interface by providing implementations for the members of the interface. An empty interface does not define any members; therefore, it does not define a contract that can be implemented.",
"defaultLevel": "warning",
"helpUri": "https://docs.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1040",
"properties": {
"category": "Design",
"isEnabledByDefault": false,
"typeName": "AvoidEmptyInterfacesAnalyzer",
"languages": [
"C#",
"Visual Basic"
],
"tags": [
"PortedFromFxCop",
"Telemetry",
"EnabledRuleInAggressiveMode"
]
}
},
"CA1041": {
"id": "CA1041",
"shortDescription": "Provide ObsoleteAttribute message",
"fullDescription": "A type or member is marked by using a System.ObsoleteAttribute attribute that does not have its ObsoleteAttribute.Message property specified. When a type or member that is marked by using ObsoleteAttribute is compiled, the Message property of the attribute is displayed. This gives the user information about the obsolete type or member.",
"defaultLevel": "note",
"helpUri": "https://docs.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1041",
"properties": {
"category": "Design",
"isEnabledByDefault": true,
"typeName": "ProvideObsoleteAttributeMessageAnalyzer",
"languages": [
"C#",
"Visual Basic"
],
"tags": [
"PortedFromFxCop",
"Telemetry",
"EnabledRuleInAggressiveMode"
]
}
},
"CA1043": {
"id": "CA1043",
"shortDescription": "Use Integral Or String Argument For Indexers",
"fullDescription": "Indexers, that is, indexed properties, should use integer or string types for the index. These types are typically used for indexing data structures and increase the usability of the library. Use of the Object type should be restricted to those cases where the specific integer or string type cannot be specified at design time. If the design requires other types for the index, reconsider whether the type represents a logical data store. If it does not represent a logical data store, use a method.",
"defaultLevel": "warning",
"helpUri": "https://docs.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1043",
"properties": {
"category": "Design",
"isEnabledByDefault": false,
"typeName": "UseIntegralOrStringArgumentForIndexersAnalyzer",
"languages": [
"C#",
"Visual Basic"
],
"tags": [
"PortedFromFxCop",
"Telemetry",
"EnabledRuleInAggressiveMode"
]
}
},
"CA1044": {
"id": "CA1044",
"shortDescription": "Properties should not be write only",
"fullDescription": "Although it is acceptable and often necessary to have a read-only property, the design guidelines prohibit the use of write-only properties. This is because letting a user set a value, and then preventing the user from viewing that value, does not provide any security. Also, without read access, the state of shared objects cannot be viewed, which limits their usefulness.",
"defaultLevel": "warning",
"helpUri": "https://docs.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1044",
"properties": {
"category": "Design",
"isEnabledByDefault": false,
"typeName": "PropertiesShouldNotBeWriteOnlyAnalyzer",
"languages": [
"C#",
"Visual Basic"
],
"tags": [
"PortedFromFxCop",
"Telemetry",
"EnabledRuleInAggressiveMode"
]
}
},
"CA1045": {
"id": "CA1045",
"shortDescription": "Do not pass types by reference",
"fullDescription": "Passing types by reference (using out or ref) requires experience with pointers, understanding how value types and reference types differ, and handling methods that have multiple return values. Also, the difference between out and ref parameters is not widely understood.",
"defaultLevel": "warning",
"helpUri": "https://docs.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1045",
"properties": {
"category": "Design",
"isEnabledByDefault": false,
"typeName": "DoNotPassTypesByReference",
"languages": [
"C#",
"Visual Basic"
],
"tags": [
"PortedFromFxCop",
"Telemetry"
]
}
},
"CA1046": {
"id": "CA1046",
"shortDescription": "Do not overload equality operator on reference types",
"fullDescription": "For reference types, the default implementation of the equality operator is almost always correct. By default, two references are equal only if they point to the same object. If the operator is providing meaningful value equality, the type should implement the generic 'System.IEquatable' interface.",
"defaultLevel": "warning",
"helpUri": "https://docs.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1046",
"properties": {
"category": "Design",
"isEnabledByDefault": false,
"typeName": "DoNotOverloadOperatorEqualsOnReferenceTypes",
"languages": [
"C#",
"Visual Basic"
],
"tags": [
"PortedFromFxCop",
"Telemetry",
"EnabledRuleInAggressiveMode"
]
}
},
"CA1047": {
"id": "CA1047",
"shortDescription": "Do not declare protected member in sealed type",
"fullDescription": "Types declare protected members so that inheriting types can access or override the member. By definition, you cannot inherit from a sealed type, which means that protected methods on sealed types cannot be called.",
"defaultLevel": "note",
"helpUri": "https://docs.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1047",
"properties": {
"category": "Design",
"isEnabledByDefault": true,
"typeName": "DoNotDeclareProtectedMembersInSealedTypes",
"languages": [
"Visual Basic"
],
"tags": [
"PortedFromFxCop",
"Telemetry",
"EnabledRuleInAggressiveMode"
]
}
},
"CA1050": {
"id": "CA1050",
"shortDescription": "Declare types in namespaces",
"fullDescription": "Types are declared in namespaces to prevent name collisions and as a way to organize related types in an object hierarchy.",
"defaultLevel": "note",
"helpUri": "https://docs.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1050",
"properties": {
"category": "Design",
"isEnabledByDefault": true,
"typeName": "DeclareTypesInNamespacesAnalyzer",
"languages": [
"C#",
"Visual Basic"
],
"tags": [
"PortedFromFxCop",
"Telemetry",
"EnabledRuleInAggressiveMode"
]
}
},
"CA1051": {