forked from dotnet/roslyn-analyzers
/
Microsoft.CodeAnalysis.FxCopAnalyzers.sarif
4223 lines (4223 loc) · 189 KB
/
Microsoft.CodeAnalysis.FxCopAnalyzers.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.VersionCheckAnalyzer",
"version": "2.9.5",
"language": "en-US"
},
"rules": {
"CA9999": {
"id": "CA9999",
"shortDescription": "Analyzer version mismatch",
"fullDescription": "Analyzers in this package require a certain minimum version of Microsoft.CodeAnalysis to execute correctly. Refer to https://docs.microsoft.com/visualstudio/code-quality/install-fxcop-analyzers#fxcopanalyzers-package-versions to install the correct analyzer version.",
"defaultLevel": "warning",
"properties": {
"category": "Reliability",
"isEnabledByDefault": true,
"typeName": "AnalyzerVersionCheckAnalyzer",
"languages": [
"C#",
"Visual Basic"
]
}
}
}
},
{
"tool": {
"name": "Microsoft.CodeQuality.Analyzers",
"version": "2.9.5",
"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": "warning",
"helpUri": "https://docs.microsoft.com/visualstudio/code-quality/ca1000-do-not-declare-static-members-on-generic-types",
"properties": {
"category": "Design",
"isEnabledByDefault": true,
"typeName": "DoNotDeclareStaticMembersOnGenericTypesAnalyzer",
"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/visualstudio/code-quality/ca1008-enums-should-have-zero-value",
"properties": {
"category": "Design",
"isEnabledByDefault": false,
"typeName": "EnumsShouldHaveZeroValueAnalyzer",
"languages": [
"C#",
"Visual Basic"
],
"tags": [
"PortedFromFxCop",
"Telemetry",
"RuleNoZero"
]
}
},
"CA1010": {
"id": "CA1010",
"shortDescription": "Collections should implement generic interface",
"fullDescription": "To broaden the usability of a collection, implement one of the generic collection interfaces. Then the collection can be used to populate generic collection types.",
"defaultLevel": "warning",
"helpUri": "https://docs.microsoft.com/visualstudio/code-quality/ca1010-collections-should-implement-generic-interface",
"properties": {
"category": "Design",
"isEnabledByDefault": true,
"typeName": "CollectionsShouldImplementGenericInterfaceAnalyzer",
"languages": [
"C#",
"Visual Basic"
],
"tags": [
"PortedFromFxCop",
"Telemetry"
]
}
},
"CA1012": {
"id": "CA1012",
"shortDescription": "Abstract types should not have 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/visualstudio/code-quality/ca1012-abstract-types-should-not-have-constructors",
"properties": {
"category": "Design",
"isEnabledByDefault": false,
"typeName": "AbstractTypesShouldNotHaveConstructorsAnalyzer",
"languages": [
"C#",
"Visual Basic"
],
"tags": [
"PortedFromFxCop",
"Telemetry"
]
}
},
"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/visualstudio/code-quality/ca1014-mark-assemblies-with-clscompliantattribute",
"properties": {
"category": "Design",
"isEnabledByDefault": false,
"typeName": "MarkAssembliesWithAttributesDiagnosticAnalyzer",
"languages": [
"C#",
"Visual Basic"
],
"tags": [
"PortedFromFxCop",
"Telemetry"
]
}
},
"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": "warning",
"helpUri": "https://docs.microsoft.com/visualstudio/code-quality/ca1016-mark-assemblies-with-assemblyversionattribute",
"properties": {
"category": "Design",
"isEnabledByDefault": true,
"typeName": "MarkAssembliesWithAttributesDiagnosticAnalyzer",
"languages": [
"C#",
"Visual Basic"
],
"tags": [
"PortedFromFxCop",
"Telemetry"
]
}
},
"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/visualstudio/code-quality/ca1017-mark-assemblies-with-comvisibleattribute",
"properties": {
"category": "Design",
"isEnabledByDefault": false,
"typeName": "MarkAssembliesWithComVisibleAnalyzer",
"languages": [
"C#",
"Visual Basic"
],
"tags": [
"PortedFromFxCop",
"Telemetry"
]
}
},
"CA1018": {
"id": "CA1018",
"shortDescription": "Mark attributes with AttributeUsageAttribute",
"fullDescription": "Specify AttributeUsage on {0}.",
"defaultLevel": "warning",
"helpUri": "https://docs.microsoft.com/visualstudio/code-quality/ca1018-mark-attributes-with-attributeusageattribute",
"properties": {
"category": "Design",
"isEnabledByDefault": true,
"typeName": "MarkAttributesWithAttributeUsageAnalyzer",
"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/visualstudio/code-quality/ca1024-use-properties-where-appropriate",
"properties": {
"category": "Design",
"isEnabledByDefault": false,
"typeName": "UsePropertiesWhereAppropriateAnalyzer",
"languages": [
"C#",
"Visual Basic"
],
"tags": [
"PortedFromFxCop",
"Telemetry"
]
}
},
"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/visualstudio/code-quality/ca1027-mark-enums-with-flagsattribute",
"properties": {
"category": "Design",
"isEnabledByDefault": false,
"typeName": "EnumWithFlagsAttributeAnalyzer",
"languages": [
"C#",
"Visual Basic"
],
"tags": [
"PortedFromFxCop",
"Telemetry"
]
}
},
"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/visualstudio/code-quality/ca1028-enum-storage-should-be-int32",
"properties": {
"category": "Design",
"isEnabledByDefault": true,
"typeName": "EnumStorageShouldBeInt32Analyzer",
"languages": [
"C#",
"Visual Basic"
],
"tags": [
"PortedFromFxCop",
"Telemetry"
]
}
},
"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/visualstudio/code-quality/ca1030-use-events-where-appropriate",
"properties": {
"category": "Design",
"isEnabledByDefault": true,
"typeName": "UseEventsWhereAppropriateAnalyzer",
"languages": [
"C#",
"Visual Basic"
],
"tags": [
"PortedFromFxCop",
"Telemetry"
]
}
},
"CA1031": {
"id": "CA1031",
"shortDescription": "Do not catch general exception types",
"fullDescription": "A general exception such as System.Exception or System.SystemException is caught in a catch statement, or a general catch clause is used. General exceptions should not be caught.",
"defaultLevel": "warning",
"helpUri": "https://docs.microsoft.com/en-us/visualstudio/code-quality/ca1031-do-not-catch-general-exception-types",
"properties": {
"category": "Design",
"isEnabledByDefault": true,
"typeName": "DoNotCatchGeneralExceptionTypesAnalyzer",
"languages": [
"C#",
"Visual Basic"
],
"tags": [
"PortedFromFxCop",
"Telemetry"
]
}
},
"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/visualstudio/code-quality/ca1033-interface-methods-should-be-callable-by-child-types",
"properties": {
"category": "Design",
"isEnabledByDefault": false,
"typeName": "InterfaceMethodsShouldBeCallableByChildTypesAnalyzer",
"languages": [
"C#",
"Visual Basic"
],
"tags": [
"PortedFromFxCop",
"Telemetry"
]
}
},
"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/visualstudio/code-quality/ca1034-nested-types-should-not-be-visible",
"properties": {
"category": "Design",
"isEnabledByDefault": true,
"typeName": "NestedTypesShouldNotBeVisibleAnalyzer",
"languages": [
"C#",
"Visual Basic"
],
"tags": [
"PortedFromFxCop",
"Telemetry"
]
}
},
"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": "warning",
"helpUri": "https://docs.microsoft.com/visualstudio/code-quality/ca1036-override-methods-on-comparable-types",
"properties": {
"category": "Design",
"isEnabledByDefault": true,
"typeName": "OverrideMethodsOnComparableTypesAnalyzer",
"languages": [
"C#",
"Visual Basic"
],
"tags": [
"PortedFromFxCop",
"Telemetry"
]
}
},
"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/visualstudio/code-quality/ca1040-avoid-empty-interfaces",
"properties": {
"category": "Design",
"isEnabledByDefault": true,
"typeName": "AvoidEmptyInterfacesAnalyzer",
"languages": [
"C#",
"Visual Basic"
],
"tags": [
"PortedFromFxCop",
"Telemetry"
]
}
},
"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": "warning",
"helpUri": "https://docs.microsoft.com/visualstudio/code-quality/ca1041-provide-obsoleteattribute-message",
"properties": {
"category": "Design",
"isEnabledByDefault": true,
"typeName": "ProvideObsoleteAttributeMessageAnalyzer",
"languages": [
"C#",
"Visual Basic"
],
"tags": [
"PortedFromFxCop",
"Telemetry"
]
}
},
"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/visualstudio/code-quality/ca1043-use-integral-or-string-argument-for-indexers",
"properties": {
"category": "Design",
"isEnabledByDefault": true,
"typeName": "UseIntegralOrStringArgumentForIndexersAnalyzer",
"languages": [
"C#",
"Visual Basic"
],
"tags": [
"PortedFromFxCop",
"Telemetry"
]
}
},
"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/visualstudio/code-quality/ca1044-properties-should-not-be-write-only",
"properties": {
"category": "Design",
"isEnabledByDefault": true,
"typeName": "PropertiesShouldNotBeWriteOnlyAnalyzer",
"languages": [
"C#",
"Visual Basic"
],
"tags": [
"PortedFromFxCop",
"Telemetry"
]
}
},
"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": "warning",
"helpUri": "https://docs.microsoft.com/visualstudio/code-quality/ca1050-declare-types-in-namespaces",
"properties": {
"category": "Design",
"isEnabledByDefault": false,
"typeName": "DeclareTypesInNamespacesAnalyzer",
"languages": [
"C#",
"Visual Basic"
],
"tags": [
"PortedFromFxCop",
"Telemetry"
]
}
},
"CA1051": {
"id": "CA1051",
"shortDescription": "Do not declare visible instance fields",
"fullDescription": "The primary use of a field should be as an implementation detail. Fields should be private or internal and should be exposed by using properties.",
"defaultLevel": "warning",
"helpUri": "https://docs.microsoft.com/visualstudio/code-quality/ca1051-do-not-declare-visible-instance-fields",
"properties": {
"category": "Design",
"isEnabledByDefault": true,
"typeName": "DoNotDeclareVisibleInstanceFieldsAnalyzer",
"languages": [
"C#",
"Visual Basic"
],
"tags": [
"PortedFromFxCop",
"Telemetry"
]
}
},
"CA1052": {
"id": "CA1052",
"shortDescription": "Static holder types should be Static or NotInheritable",
"fullDescription": "Type '{0}' is a static holder type but is neither static nor NotInheritable",
"defaultLevel": "warning",
"helpUri": "https://docs.microsoft.com/visualstudio/code-quality/ca1052-static-holder-types-should-be-sealed",
"properties": {
"category": "Design",
"isEnabledByDefault": true,
"typeName": "StaticHolderTypesAnalyzer",
"languages": [
"C#",
"Visual Basic"
],
"tags": [
"PortedFromFxCop",
"Telemetry"
]
}
},
"CA1054": {
"id": "CA1054",
"shortDescription": "Uri parameters should not be strings",
"fullDescription": "If a method takes a string representation of a URI, a corresponding overload should be provided that takes an instance of the URI class, which provides these services in a safe and secure manner.",
"defaultLevel": "warning",
"helpUri": "https://docs.microsoft.com/visualstudio/code-quality/ca1054-uri-parameters-should-not-be-strings",
"properties": {
"category": "Design",
"isEnabledByDefault": true,
"typeName": "UriParametersShouldNotBeStringsAnalyzer",
"languages": [
"C#",
"Visual Basic"
],
"tags": [
"PortedFromFxCop",
"Telemetry"
]
}
},
"CA1055": {
"id": "CA1055",
"shortDescription": "Uri return values should not be strings",
"fullDescription": "This rule assumes that the method returns a URI. A string representation of a URI is prone to parsing and encoding errors, and can lead to security vulnerabilities. The System.Uri class provides these services in a safe and secure manner.",
"defaultLevel": "warning",
"helpUri": "https://docs.microsoft.com/visualstudio/code-quality/ca1055-uri-return-values-should-not-be-strings",
"properties": {
"category": "Design",
"isEnabledByDefault": true,
"typeName": "UriReturnValuesShouldNotBeStringsAnalyzer",
"languages": [
"C#",
"Visual Basic"
],
"tags": [
"PortedFromFxCop",
"Telemetry"
]
}
},
"CA1056": {
"id": "CA1056",
"shortDescription": "Uri properties should not be strings",
"fullDescription": "This rule assumes that the property represents a Uniform Resource Identifier (URI). A string representation of a URI is prone to parsing and encoding errors, and can lead to security vulnerabilities. The System.Uri class provides these services in a safe and secure manner.",
"defaultLevel": "warning",
"helpUri": "https://docs.microsoft.com/visualstudio/code-quality/ca1056-uri-properties-should-not-be-strings",
"properties": {
"category": "Design",
"isEnabledByDefault": true,
"typeName": "UriPropertiesShouldNotBeStringsAnalyzer",
"languages": [
"C#",
"Visual Basic"
],
"tags": [
"PortedFromFxCop",
"Telemetry"
]
}
},
"CA1060": {
"id": "CA1060",
"shortDescription": "Move pinvokes to native methods class",
"fullDescription": "Platform Invocation methods, such as those that are marked by using the System.Runtime.InteropServices.DllImportAttribute attribute, or methods that are defined by using the Declare keyword in Visual Basic, access unmanaged code. These methods should be of the NativeMethods, SafeNativeMethods, or UnsafeNativeMethods class.",
"defaultLevel": "warning",
"helpUri": "https://docs.microsoft.com/visualstudio/code-quality/ca1060-move-p-invokes-to-nativemethods-class",
"properties": {
"category": "Design",
"isEnabledByDefault": false,
"typeName": "MovePInvokesToNativeMethodsClassAnalyzer",
"languages": [
"C#",
"Visual Basic"
],
"tags": [
"PortedFromFxCop",
"Telemetry"
]
}
},
"CA1061": {
"id": "CA1061",
"shortDescription": "Do not hide base class methods",
"fullDescription": "A method in a base type is hidden by an identically named method in a derived type when the parameter signature of the derived method differs only by types that are more weakly derived than the corresponding types in the parameter signature of the base method.",
"defaultLevel": "warning",
"helpUri": "https://docs.microsoft.com/visualstudio/code-quality/ca1061-do-not-hide-base-class-methods",
"properties": {
"category": "Design",
"isEnabledByDefault": true,
"typeName": "DoNotHideBaseClassMethodsAnalyzer",
"languages": [
"C#",
"Visual Basic"
],
"tags": [
"PortedFromFxCop",
"Telemetry"
]
}
},
"CA1062": {
"id": "CA1062",
"shortDescription": "Validate arguments of public methods",
"fullDescription": "An externally visible method dereferences one of its reference arguments without verifying whether that argument is null (Nothing in Visual Basic). All reference arguments that are passed to externally visible methods should be checked against null. If appropriate, throw an ArgumentNullException when the argument is null or add a Code Contract precondition asserting non-null argument. If the method is designed to be called only by known assemblies, you should make the method internal.",
"defaultLevel": "warning",
"helpUri": "https://docs.microsoft.com/visualstudio/code-quality/ca1062-validate-arguments-of-public-methods",
"properties": {
"category": "Design",
"isEnabledByDefault": true,
"typeName": "ValidateArgumentsOfPublicMethods",
"languages": [
"C#",
"Visual Basic"
],
"tags": [
"PortedFromFxCop",
"Dataflow",
"Telemetry"
]
}
},
"CA1063": {
"id": "CA1063",
"shortDescription": "Implement IDisposable Correctly",
"fullDescription": "All IDisposable types should implement the Dispose pattern correctly.",
"defaultLevel": "warning",
"helpUri": "https://docs.microsoft.com/visualstudio/code-quality/ca1063-implement-idisposable-correctly",
"properties": {
"category": "Design",
"isEnabledByDefault": true,
"typeName": "ImplementIDisposableCorrectlyAnalyzer",
"languages": [
"C#",
"Visual Basic"
],
"tags": [
"PortedFromFxCop",
"Telemetry"
]
}
},
"CA1064": {
"id": "CA1064",
"shortDescription": "Exceptions should be public",
"fullDescription": "An internal exception is visible only inside its own internal scope. After the exception falls outside the internal scope, only the base exception can be used to catch the exception. If the internal exception is inherited from T:System.Exception, T:System.SystemException, or T:System.ApplicationException, the external code will not have sufficient information to know what to do with the exception.",
"defaultLevel": "warning",
"helpUri": "https://docs.microsoft.com/visualstudio/code-quality/ca1064-exceptions-should-be-public",
"properties": {
"category": "Design",
"isEnabledByDefault": true,
"typeName": "ExceptionsShouldBePublicAnalyzer",
"languages": [
"C#",
"Visual Basic"
],
"tags": [
"PortedFromFxCop",
"Telemetry"
]
}
},
"CA1066": {
"id": "CA1066",
"shortDescription": "Type {0} should implement IEquatable<T> because it overrides Equals",
"fullDescription": "When a type T overrides Object.Equals(object), the implementation must cast the object argument to the correct type T before performing the comparison. If the type implements IEquatable<T>, and therefore offers the method T.Equals(T), and if the argument is known at compile time to be of type T, then the compiler can call IEquatable<T>.Equals(T) instead of Object.Equals(object), and no cast is necessary, improving performance.",
"defaultLevel": "warning",
"helpUri": "http://go.microsoft.com/fwlink/?LinkId=734907",
"properties": {
"category": "Design",
"isEnabledByDefault": true,
"typeName": "EquatableAnalyzer",
"languages": [
"C#",
"Visual Basic"
]
}
},
"CA1067": {
"id": "CA1067",
"shortDescription": "Override Object.Equals(object) when implementing IEquatable<T>",
"fullDescription": "When a type T implements the interface IEquatable<T>, it suggests to a user who sees a call to the Equals method in source code that an instance of the type can be equated with an instance of any other type. The user might be confused if their attempt to equate the type with an instance of another type fails to compile. This violates the \"principle of least surprise\".",
"defaultLevel": "warning",
"helpUri": "http://go.microsoft.com/fwlink/?LinkId=734909",
"properties": {
"category": "Design",
"isEnabledByDefault": true,
"typeName": "EquatableAnalyzer",
"languages": [
"C#",
"Visual Basic"
]
}
},
"CA1068": {
"id": "CA1068",
"shortDescription": "CancellationToken parameters must come last",
"fullDescription": "Method '{0}' should take CancellationToken as the last parameter",
"defaultLevel": "warning",
"properties": {
"category": "Design",
"isEnabledByDefault": true,
"typeName": "CancellationTokenParametersMustComeLastAnalyzer",
"languages": [
"C#",
"Visual Basic"
]
}
},
"CA1501": {
"id": "CA1501",
"shortDescription": "Avoid excessive inheritance",
"fullDescription": "Deeply nested type hierarchies can be difficult to follow, understand, and maintain. This rule limits analysis to hierarchies in the same module. To fix a violation of this rule, derive the type from a base type that is less deep in the inheritance hierarchy or eliminate some of the intermediate base types.",
"defaultLevel": "warning",
"helpUri": "https://docs.microsoft.com/visualstudio/code-quality/ca1501-avoid-excessive-inheritance",
"properties": {
"category": "Maintainability",
"isEnabledByDefault": false,
"typeName": "CodeMetricsAnalyzer",
"languages": [
"C#",
"Visual Basic"
],
"tags": [
"PortedFromFxCop",
"Telemetry"
]
}
},
"CA1502": {
"id": "CA1502",
"shortDescription": "Avoid excessive complexity",
"fullDescription": "Cyclomatic complexity measures the number of linearly independent paths through the method, which is determined by the number and complexity of conditional branches. A low cyclomatic complexity generally indicates a method that is easy to understand, test, and maintain. The cyclomatic complexity is calculated from a control flow graph of the method and is given as follows: `cyclomatic complexity = the number of edges - the number of nodes + 1`, where a node represents a logic branch point and an edge represents a line between nodes.",
"defaultLevel": "warning",
"helpUri": "https://docs.microsoft.com/visualstudio/code-quality/ca1502-avoid-excessive-complexity",
"properties": {
"category": "Maintainability",
"isEnabledByDefault": false,
"typeName": "CodeMetricsAnalyzer",
"languages": [
"C#",
"Visual Basic"
],
"tags": [
"PortedFromFxCop",
"Telemetry"
]
}
},
"CA1505": {
"id": "CA1505",
"shortDescription": "Avoid unmaintainable code",
"fullDescription": "The maintainability index is calculated by using the following metrics: lines of code, program volume, and cyclomatic complexity. Program volume is a measure of the difficulty of understanding of a symbol that is based on the number of operators and operands in the code. Cyclomatic complexity is a measure of the structural complexity of the type or method. A low maintainability index indicates that code is probably difficult to maintain and would be a good candidate to redesign.",
"defaultLevel": "warning",
"helpUri": "https://docs.microsoft.com/visualstudio/code-quality/ca1505-avoid-unmaintainable-code",
"properties": {
"category": "Maintainability",
"isEnabledByDefault": false,
"typeName": "CodeMetricsAnalyzer",
"languages": [
"C#",
"Visual Basic"
],
"tags": [
"PortedFromFxCop",
"Telemetry"
]
}
},
"CA1506": {
"id": "CA1506",
"shortDescription": "Avoid excessive class coupling",
"fullDescription": "This rule measures class coupling by counting the number of unique type references that a symbol contains. Symbols that have a high degree of class coupling can be difficult to maintain. It is a good practice to have types and methods that exhibit low coupling and high cohesion. To fix this violation, try to redesign the code to reduce the number of types to which it is coupled.",
"defaultLevel": "warning",
"helpUri": "https://docs.microsoft.com/visualstudio/code-quality/ca1506-avoid-excessive-class-coupling",
"properties": {
"category": "Maintainability",
"isEnabledByDefault": false,
"typeName": "CodeMetricsAnalyzer",
"languages": [
"C#",
"Visual Basic"
],
"tags": [
"PortedFromFxCop",
"Telemetry"
]
}
},
"CA1508": {
"id": "CA1508",
"shortDescription": "Avoid dead conditional code",
"fullDescription": "'{0}' is always '{1}'. Remove or refactor the condition(s) to avoid dead code.",
"defaultLevel": "warning",
"properties": {
"category": "Maintainability",
"isEnabledByDefault": false,
"typeName": "AvoidDeadConditionalCode",
"languages": [
"C#",
"Visual Basic"
],
"tags": [
"Dataflow",
"Telemetry"
]
}
},
"CA1509": {
"id": "CA1509",
"shortDescription": "Invalid entry in code metrics rule specification file",
"fullDescription": "Invalid entry in code metrics rule specification file",
"defaultLevel": "warning",
"properties": {
"category": "Maintainability",
"isEnabledByDefault": false,
"typeName": "CodeMetricsAnalyzer",
"languages": [
"C#",
"Visual Basic"
],
"tags": [
"Telemetry"
]
}
},
"CA1707": {
"id": "CA1707",
"shortDescription": "Identifiers should not contain underscores",
"fullDescription": "By convention, identifier names do not contain the underscore (_) character. This rule checks namespaces, types, members, and parameters.",
"defaultLevel": "warning",
"helpUri": "https://docs.microsoft.com/visualstudio/code-quality/ca1707-identifiers-should-not-contain-underscores",
"properties": {
"category": "Naming",
"isEnabledByDefault": true,
"typeName": "IdentifiersShouldNotContainUnderscoresAnalyzer",
"languages": [
"C#",
"Visual Basic"
],
"tags": [
"PortedFromFxCop",
"Telemetry"
]
}
},
"CA1708": {
"id": "CA1708",
"shortDescription": "Identifiers should differ by more than case",
"fullDescription": "Identifiers for namespaces, types, members, and parameters cannot differ only by case because languages that target the common language runtime are not required to be case-sensitive.",
"defaultLevel": "warning",
"helpUri": "https://docs.microsoft.com/visualstudio/code-quality/ca1708-identifiers-should-differ-by-more-than-case",
"properties": {
"category": "Naming",
"isEnabledByDefault": false,
"typeName": "IdentifiersShouldDifferByMoreThanCaseAnalyzer",
"languages": [
"C#",
"Visual Basic"
],
"tags": [
"PortedFromFxCop",
"Telemetry"
]
}
},
"CA1710": {
"id": "CA1710",
"shortDescription": "Identifiers should have correct suffix",
"fullDescription": "By convention, the names of types that extend certain base types or that implement certain interfaces, or types that are derived from these types, have a suffix that is associated with the base type or interface.",
"defaultLevel": "warning",
"helpUri": "https://docs.microsoft.com/visualstudio/code-quality/ca1710-identifiers-should-have-correct-suffix",
"properties": {
"category": "Naming",
"isEnabledByDefault": true,
"typeName": "IdentifiersShouldHaveCorrectSuffixAnalyzer",
"languages": [
"C#",
"Visual Basic"
],
"tags": [
"PortedFromFxCop",
"Telemetry"
]
}
},
"CA1711": {
"id": "CA1711",
"shortDescription": "Identifiers should not have incorrect suffix",
"fullDescription": "By convention, only the names of types that extend certain base types or that implement certain interfaces, or types that are derived from these types, should end with specific reserved suffixes. Other type names should not use these reserved suffixes.",
"defaultLevel": "warning",
"helpUri": "https://docs.microsoft.com/visualstudio/code-quality/ca1711-identifiers-should-not-have-incorrect-suffix",
"properties": {
"category": "Naming",
"isEnabledByDefault": false,
"typeName": "IdentifiersShouldNotHaveIncorrectSuffixAnalyzer",
"languages": [
"C#",
"Visual Basic"
],
"tags": [
"PortedFromFxCop",
"Telemetry"
]
}
},
"CA1712": {
"id": "CA1712",
"shortDescription": "Do not prefix enum values with type name",
"fullDescription": "An enumeration's values should not start with the type name of the enumeration.",
"defaultLevel": "warning",
"helpUri": "https://docs.microsoft.com/en-us/visualstudio/code-quality/ca1712-do-not-prefix-enum-values-with-type-name",
"properties": {
"category": "Naming",
"isEnabledByDefault": true,
"typeName": "DoNotPrefixEnumValuesWithTypeNameAnalyzer",
"languages": [
"C#",
"Visual Basic"
],
"tags": [
"PortedFromFxCop",
"Telemetry"
]
}
},
"CA1714": {
"id": "CA1714",
"shortDescription": "Flags enums should have plural names",
"fullDescription": "A public enumeration has the System.FlagsAttribute attribute, and its name does not end in \"\"s\"\". Types that are marked by using FlagsAttribute have names that are plural because the attribute indicates that more than one value can be specified.",
"defaultLevel": "warning",
"helpUri": "https://docs.microsoft.com/visualstudio/code-quality/ca1714-flags-enums-should-have-plural-names",
"properties": {
"category": "Naming",
"isEnabledByDefault": true,
"typeName": "EnumsShouldHavePluralNamesAnalyzer",
"languages": [
"C#",
"Visual Basic"
],
"tags": [
"PortedFromFxCop",
"Telemetry"
]
}
},
"CA1715": {
"id": "CA1715",
"shortDescription": "Identifiers should have correct prefix",
"fullDescription": "Identifiers should have correct prefix",
"defaultLevel": "warning",
"helpUri": "https://docs.microsoft.com/visualstudio/code-quality/ca1715-identifiers-should-have-correct-prefix",
"properties": {
"category": "Naming",
"isEnabledByDefault": true,
"typeName": "IdentifiersShouldHaveCorrectPrefixAnalyzer",
"languages": [
"C#",
"Visual Basic"
],
"tags": [
"PortedFromFxCop",
"Telemetry"
]
}
},
"CA1716": {
"id": "CA1716",
"shortDescription": "Identifiers should not match keywords",
"fullDescription": "A namespace name or a type name matches a reserved keyword in a programming language. Identifiers for namespaces and types should not match keywords that are defined by languages that target the common language runtime.",
"defaultLevel": "warning",
"helpUri": "https://docs.microsoft.com/visualstudio/code-quality/ca1716-identifiers-should-not-match-keywords",
"properties": {
"category": "Naming",
"isEnabledByDefault": true,
"typeName": "IdentifiersShouldNotMatchKeywordsAnalyzer",
"languages": [
"C#",
"Visual Basic"
],
"tags": [
"PortedFromFxCop",
"Telemetry"
]
}
},
"CA1717": {
"id": "CA1717",
"shortDescription": "Only FlagsAttribute enums should have plural names",
"fullDescription": "Naming conventions dictate that a plural name for an enumeration indicates that more than one value of the enumeration can be specified at the same time.",
"defaultLevel": "warning",
"helpUri": "https://docs.microsoft.com/visualstudio/code-quality/ca1717-only-flagsattribute-enums-should-have-plural-names",
"properties": {
"category": "Naming",
"isEnabledByDefault": true,
"typeName": "EnumsShouldHavePluralNamesAnalyzer",
"languages": [
"C#",
"Visual Basic"
],
"tags": [
"PortedFromFxCop",
"Telemetry"
]
}