slopthreshold 2.1.0.dev22__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (44) hide show
  1. slopthreshold/__init__.py +1 -0
  2. slopthreshold/guide/STYLE_GUIDE.md +495 -0
  3. slopthreshold/packs/editorconfig-pack/.editorconfig +899 -0
  4. slopthreshold/packs/editorconfig-pack/Directory.Build.props +47 -0
  5. slopthreshold/packs/editorconfig-pack/Directory.Build.targets +16 -0
  6. slopthreshold/packs/editorconfig-pack/Directory.Packages.props +29 -0
  7. slopthreshold/packs/editorconfig-pack/README.md +141 -0
  8. slopthreshold/packs/editorconfig-pack/global.json +7 -0
  9. slopthreshold/packs/editorconfig-pack/nuget.config +19 -0
  10. slopthreshold/packs/editorconfig-pack/ruff.toml +29 -0
  11. slopthreshold/packs/editorconfig-pack/sonar-drift-allowlist.json +10 -0
  12. slopthreshold/packs/frontend-lint-pack/.prettierrc.json +7 -0
  13. slopthreshold/packs/frontend-lint-pack/.stylelintrc.json +64 -0
  14. slopthreshold/packs/frontend-lint-pack/README.md +64 -0
  15. slopthreshold/packs/frontend-lint-pack/eslint.config.mjs +108 -0
  16. slopthreshold/packs/frontend-lint-pack/package.json +23 -0
  17. slopthreshold/packs/frontend-lint-pack/tsconfig.app.json +17 -0
  18. slopthreshold/packs/frontend-lint-pack/tsconfig.base.json +20 -0
  19. slopthreshold/packs/frontend-lint-pack/tsconfig.json +4 -0
  20. slopthreshold/packs/frontend-lint-pack/tsconfig.spec.json +8 -0
  21. slopthreshold/packs/project-guide-starters/app-STYLE_GUIDE.md +35 -0
  22. slopthreshold/packs/project-guide-starters/frontend-STYLE_GUIDE.md +33 -0
  23. slopthreshold/packs/project-guide-starters/library-STYLE_GUIDE.md +36 -0
  24. slopthreshold/packs/three-layer-wiring/.githooks/commit-msg +13 -0
  25. slopthreshold/packs/three-layer-wiring/.githooks/post-merge +8 -0
  26. slopthreshold/packs/three-layer-wiring/.githooks/pre-commit +10 -0
  27. slopthreshold/packs/three-layer-wiring/.githooks/pre-push +14 -0
  28. slopthreshold/packs/three-layer-wiring/.github/actionlint.yaml +3 -0
  29. slopthreshold/packs/three-layer-wiring/.github/workflows/quality.yml +164 -0
  30. slopthreshold/packs/three-layer-wiring/.gitleaks.toml +16 -0
  31. slopthreshold/packs/three-layer-wiring/.hadolint.yaml +6 -0
  32. slopthreshold/packs/three-layer-wiring/README.md +62 -0
  33. slopthreshold/packs/three-layer-wiring/budget.json +14 -0
  34. slopthreshold/tools/check_characters.py +104 -0
  35. slopthreshold/tools/check_ci_config.py +405 -0
  36. slopthreshold/tools/check_package_health.py +554 -0
  37. slopthreshold/tools/check_sonar_drift.py +1123 -0
  38. slopthreshold/tools/mine_sonar_metrics.py +1259 -0
  39. slopthreshold/tools/validate_guide_tags.py +795 -0
  40. slopthreshold/zh.py +973 -0
  41. slopthreshold-2.1.0.dev22.dist-info/METADATA +49 -0
  42. slopthreshold-2.1.0.dev22.dist-info/RECORD +44 -0
  43. slopthreshold-2.1.0.dev22.dist-info/WHEEL +4 -0
  44. slopthreshold-2.1.0.dev22.dist-info/entry_points.txt +2 -0
@@ -0,0 +1,899 @@
1
+ # Generalized Style Guide v1.1 — root .editorconfig
2
+ # Pre-empts the repeated SonarQube findings mined 2026-12-02 (see README.md).
3
+ # Severities: REQUIRED guide rules -> error/warning (build fails under
4
+ # TreatWarningsAsErrors); DEFAULT rules -> warning/suggestion.
5
+ # ReSharper/Rider-only profile items live at the bottom; Visual Studio
6
+ # ignores those keys.
7
+
8
+ root = true
9
+
10
+ [*]
11
+ charset = utf-8
12
+ end_of_line = lf
13
+ insert_final_newline = true
14
+ trim_trailing_whitespace = true
15
+ indent_style = space
16
+ indent_size = 4
17
+ tab_width = 4
18
+
19
+ [*.{yml,yaml,json,md}]
20
+ indent_size = 2
21
+
22
+ [*.{ts,html,scss,css,mjs}]
23
+ indent_size = 2
24
+
25
+ [*.cs]
26
+ # ---- Naming (SG-NAME) ----
27
+ dotnet_naming_rule.private_fields.symbols = private_fields
28
+ dotnet_naming_rule.private_fields.style = private_fields_style
29
+ dotnet_naming_rule.private_fields.severity = warning
30
+ dotnet_naming_symbols.private_fields.applicable_kinds = field
31
+ dotnet_naming_symbols.private_fields.applicable_accessibilities = private
32
+ dotnet_naming_style.private_fields_style.capitalization = camel_case
33
+ dotnet_naming_style.private_fields_style.required_prefix = _
34
+
35
+ dotnet_naming_rule.constants.symbols = constants
36
+ dotnet_naming_rule.constants.style = pascal_case_style
37
+ dotnet_naming_rule.constants.severity = warning
38
+ dotnet_naming_symbols.constants.applicable_kinds = field, property
39
+ dotnet_naming_symbols.constants.required_modifiers = const
40
+
41
+ dotnet_naming_rule.types.symbols = types
42
+ dotnet_naming_rule.types.style = pascal_case_style
43
+ dotnet_naming_rule.types.severity = warning
44
+ dotnet_naming_symbols.types.applicable_kinds = class, struct, enum, delegate
45
+
46
+ dotnet_naming_rule.interfaces.symbols = interfaces
47
+ dotnet_naming_rule.interfaces.style = interface_style
48
+ dotnet_naming_rule.interfaces.severity = warning
49
+ dotnet_naming_symbols.interfaces.applicable_kinds = interface
50
+ dotnet_naming_style.interface_style.capitalization = pascal_case
51
+ dotnet_naming_style.interface_style.required_prefix = I
52
+
53
+ dotnet_naming_rule.public_members.symbols = public_members
54
+ dotnet_naming_rule.public_members.style = pascal_case_style
55
+ dotnet_naming_rule.public_members.severity = warning
56
+ dotnet_naming_symbols.public_members.applicable_kinds = method, property, event
57
+ dotnet_naming_symbols.public_members.applicable_accessibilities = public, internal, protected, protected_internal, private_protected
58
+
59
+ dotnet_naming_rule.parameters_locals.symbols = parameters_locals
60
+ dotnet_naming_rule.parameters_locals.style = camel_case_style
61
+ dotnet_naming_rule.parameters_locals.severity = warning
62
+ dotnet_naming_symbols.parameters_locals.applicable_kinds = parameter, local
63
+ dotnet_naming_style.camel_case_style.capitalization = camel_case
64
+ dotnet_naming_style.pascal_case_style.capitalization = pascal_case
65
+
66
+ # ---- Style preferences (ST-FMT; Sonar repeats IDE0022/IDE0028/IDE0007) ----
67
+ dotnet_style_prefer_collection_expression = true:warning
68
+ csharp_style_expression_bodied_methods = true:warning
69
+ csharp_style_expression_bodied_constructors = true:warning
70
+ csharp_style_expression_bodied_operators = true:warning
71
+ csharp_style_expression_bodied_properties = true:warning
72
+ csharp_style_expression_bodied_indexers = true:warning
73
+ csharp_style_expression_bodied_accessors = true:warning
74
+ csharp_style_expression_bodied_local_functions = true:warning
75
+ csharp_style_var_for_built_in_types = true:warning
76
+ csharp_style_var_when_type_is_apparent = true:warning
77
+ csharp_style_var_elsewhere = true:warning
78
+ dotnet_style_prefer_is_null_check_over_reference_equality_method = true:warning
79
+ csharp_style_pattern_matching_over_is_with_cast_check = true:warning
80
+ csharp_style_pattern_matching_over_as_with_null_check = true:warning
81
+ dotnet_style_prefer_auto_properties = true:warning
82
+ dotnet_style_prefer_simplified_boolean_expressions = true:warning
83
+ dotnet_style_prefer_simplified_interpolation = true:warning
84
+ csharp_style_prefer_switch_expression = true:suggestion
85
+ dotnet_style_prefer_conditional_expression_over_assignment = true:suggestion
86
+ csharp_style_throw_expression = true:suggestion
87
+ dotnet_style_object_initializer = true:suggestion
88
+ dotnet_style_collection_initializer = true:suggestion
89
+ dotnet_style_prefer_compound_assignment = true:suggestion
90
+ csharp_style_namespace_declarations = file_scoped:warning
91
+ csharp_style_prefer_primary_constructors = false:warning
92
+ csharp_using_directive_placement = outside_namespace:warning
93
+ dotnet_sort_system_directives_first = true
94
+ dotnet_separate_import_directive_groups = false
95
+
96
+ # ---- Formatting ----
97
+ csharp_new_line_before_open_brace = all
98
+ csharp_new_line_before_else = true
99
+ csharp_new_line_before_catch = true
100
+ csharp_new_line_before_finally = true
101
+ csharp_new_line_before_members_in_object_initializers = true
102
+ csharp_new_line_before_members_in_anonymous_types = true
103
+ csharp_new_line_between_query_expression_clauses = true
104
+ csharp_indent_case_contents = true
105
+ csharp_indent_switch_labels = true
106
+ csharp_indent_labels = flush_left
107
+ csharp_space_after_cast = false
108
+ csharp_space_after_keywords_in_control_flow_statements = true
109
+ csharp_space_between_method_call_parameter_list_parentheses = false
110
+ csharp_space_between_method_declaration_parameter_list_parentheses = false
111
+ csharp_space_between_method_declaration_name_and_open_parenthesis = false
112
+ csharp_space_between_method_call_name_and_opening_parenthesis = false
113
+ csharp_space_after_comma = true
114
+ csharp_space_before_comma = false
115
+ csharp_space_after_semicolon_in_for_statement = true
116
+ csharp_space_before_semicolon_in_for_statement = false
117
+ csharp_space_around_binary_operators = before_and_after
118
+ csharp_space_around_declaration_statements = false
119
+ csharp_space_before_open_square_brackets = false
120
+ csharp_space_between_empty_square_brackets = false
121
+ csharp_space_between_square_brackets = false
122
+
123
+ # ---- Roslyn diagnostics (guide REQUIRED mappings + Sonar repeats) ----
124
+ dotnet_diagnostic.IDE0005.severity = warning
125
+ dotnet_diagnostic.IDE0051.severity = warning
126
+ dotnet_diagnostic.IDE0052.severity = warning
127
+ dotnet_diagnostic.IDE0060.severity = suggestion
128
+ dotnet_diagnostic.CA1031.severity = warning
129
+ dotnet_diagnostic.CA1849.severity = warning
130
+ dotnet_diagnostic.CA1861.severity = warning
131
+ dotnet_diagnostic.CA2000.severity = warning
132
+ dotnet_diagnostic.CA2007.severity = warning
133
+ dotnet_diagnostic.CA2200.severity = error
134
+ dotnet_diagnostic.CA2254.severity = warning
135
+ dotnet_diagnostic.CA1848.severity = suggestion
136
+ dotnet_diagnostic.CA5394.severity = warning
137
+ dotnet_diagnostic.CA1716.severity = warning
138
+ dotnet_diagnostic.CA1304.severity = warning
139
+ dotnet_diagnostic.CA1051.severity = warning
140
+ dotnet_diagnostic.CA1707.severity = warning
141
+ dotnet_diagnostic.CA1822.severity = suggestion
142
+ dotnet_diagnostic.CA1001.severity = warning
143
+ dotnet_diagnostic.CA1816.severity = warning
144
+ dotnet_diagnostic.CA2213.severity = warning
145
+ dotnet_diagnostic.SYSLIB1045.severity = warning
146
+ dotnet_diagnostic.CS1591.severity = warning
147
+
148
+ # ---- SonarAnalyzer rules (run in build; mined repeats, see README) ----
149
+ dotnet_diagnostic.S2306.severity = error
150
+ dotnet_diagnostic.S6966.severity = warning
151
+ # ---- Size thresholds (ST-PAT-11: method 50, class 500, file 1000, cognitive 15, cyclomatic 10, params 7) ----
152
+ dotnet_diagnostic.S3776.severity = error
153
+ dotnet_diagnostic.S107.severity = error
154
+ dotnet_diagnostic.S138.severity = error
155
+ dotnet_diagnostic.S104.severity = error
156
+ dotnet_diagnostic.CA1502.severity = error
157
+ dotnet_diagnostic.S134.severity = error
158
+ dotnet_diagnostic.CA1505.severity = warning
159
+ dotnet_diagnostic.CA1506.severity = warning
160
+ dotnet_diagnostic.MA0051.severity = error
161
+ MA0051.maximum_lines_per_method = 50
162
+ MA0051.maximum_statements_per_method = 40
163
+ dotnet_diagnostic.S3358.severity = warning
164
+ dotnet_diagnostic.S4136.severity = suggestion
165
+ dotnet_diagnostic.S2326.severity = warning
166
+ dotnet_diagnostic.S1192.severity = suggestion
167
+ dotnet_diagnostic.S3267.severity = suggestion
168
+ dotnet_diagnostic.S2743.severity = warning
169
+ dotnet_diagnostic.S8969.severity = warning
170
+ dotnet_diagnostic.S2365.severity = warning
171
+ dotnet_diagnostic.S3871.severity = warning
172
+ dotnet_diagnostic.S3011.severity = warning
173
+ dotnet_diagnostic.S2436.severity = warning
174
+ dotnet_diagnostic.S6562.severity = warning
175
+ dotnet_diagnostic.S6444.severity = warning
176
+ dotnet_diagnostic.S6672.severity = warning
177
+ dotnet_diagnostic.S3604.severity = suggestion
178
+ dotnet_diagnostic.S3220.severity = suggestion
179
+ dotnet_diagnostic.S127.severity = warning
180
+ dotnet_diagnostic.S2583.severity = warning
181
+ dotnet_diagnostic.S2589.severity = warning
182
+ dotnet_diagnostic.S1481.severity = warning
183
+ dotnet_diagnostic.S3398.severity = suggestion
184
+ dotnet_diagnostic.S1751.severity = warning
185
+ dotnet_diagnostic.S2178.severity = warning
186
+ dotnet_diagnostic.S3218.severity = warning
187
+ dotnet_diagnostic.S3875.severity = warning
188
+ dotnet_diagnostic.S4035.severity = warning
189
+ dotnet_diagnostic.S3878.severity = suggestion
190
+ dotnet_diagnostic.S125.severity = warning
191
+ dotnet_diagnostic.S2245.severity = warning
192
+ dotnet_diagnostic.S1135.severity = suggestion
193
+ dotnet_diagnostic.S101.severity = warning
194
+
195
+ # ---- Meziantou (MA0004 duplicates CA2007; keep one; MA0051 severity lives
196
+ # in the size-thresholds block above) ----
197
+ dotnet_diagnostic.MA0004.severity = none
198
+
199
+ # ---- ReSharper/Rider-only profile (ST-FMT-01/02; VS ignores these) ----
200
+ resharper_space_within_parentheses_of_control_flow_statements = true
201
+ resharper_space_within_parentheses_of_method_declaration = true
202
+ resharper_space_within_parentheses_of_method_call = true
203
+ resharper_space_within_attribute_brackets = true
204
+ resharper_align_assignments = true
205
+
206
+ # Sonar drift Batch D1 (2026-12-03): BLOCKER+CRITICAL rules pinned at
207
+ # the Sonar profile's expected local severity. Generated from the
208
+ # drift report; MAJOR/MINOR batches follow.
209
+ # S1006 [CRITICAL] Method overrides should not change parameter defaults
210
+ dotnet_diagnostic.S1006.severity = error
211
+ # S1048 [BLOCKER] Finalizers should not throw exceptions
212
+ dotnet_diagnostic.S1048.severity = error
213
+ # S1163 [CRITICAL] Exceptions should not be thrown in finally blocks
214
+ dotnet_diagnostic.S1163.severity = error
215
+ # S1186 [CRITICAL] Methods should not be empty
216
+ dotnet_diagnostic.S1186.severity = error
217
+ # S1215 [CRITICAL] "GC.Collect" should not be called
218
+ dotnet_diagnostic.S1215.severity = error
219
+ # S1699 [CRITICAL] Constructors should only call non-overridable methods
220
+ dotnet_diagnostic.S1699.severity = error
221
+ # S1944 [CRITICAL] Invalid casts should be avoided
222
+ dotnet_diagnostic.S1944.severity = error
223
+ # S1994 [CRITICAL] "for" loop increment clauses should modify the loops' counters
224
+ dotnet_diagnostic.S1994.severity = error
225
+ # S2053 [CRITICAL] Password hashing functions should use an unpredictable salt
226
+ dotnet_diagnostic.S2053.severity = error
227
+ # S2076 [BLOCKER] OS commands should not be vulnerable to command injection attacks
228
+ dotnet_diagnostic.S2076.severity = error
229
+ # S2078 [BLOCKER] LDAP queries should not be vulnerable to injection attacks
230
+ dotnet_diagnostic.S2078.severity = error
231
+ # S2083 [BLOCKER] I/O function calls should not be vulnerable to path injection attacks
232
+ dotnet_diagnostic.S2083.severity = error
233
+ # S2091 [BLOCKER] XPath expressions should not be vulnerable to injection attacks
234
+ dotnet_diagnostic.S2091.severity = error
235
+ # S2115 [BLOCKER] A secure password should be used when connecting to a database
236
+ dotnet_diagnostic.S2115.severity = error
237
+ # S2187 [BLOCKER] Test classes should contain at least one test case
238
+ dotnet_diagnostic.S2187.severity = error
239
+ # S2190 [BLOCKER] Loops and recursions should not be infinite
240
+ dotnet_diagnostic.S2190.severity = error
241
+ # S2198 [CRITICAL] Unnecessary mathematical comparisons should not be made
242
+ dotnet_diagnostic.S2198.severity = error
243
+ # S2222 [CRITICAL] Locks should be released on all paths
244
+ dotnet_diagnostic.S2222.severity = error
245
+ # S2223 [CRITICAL] Non-constant static fields should not be visible
246
+ dotnet_diagnostic.S2223.severity = error
247
+ # S2257 [CRITICAL] Custom cryptographic algorithms should not be used
248
+ dotnet_diagnostic.S2257.severity = error
249
+ # S2275 [BLOCKER] Composite format strings should not lead to unexpected behavior at runtime
250
+ dotnet_diagnostic.S2275.severity = error
251
+ # S2290 [CRITICAL] Field-like events should not be virtual
252
+ dotnet_diagnostic.S2290.severity = error
253
+ # S2291 [CRITICAL] Overflow checking should not be disabled for "Enumerable.Sum"
254
+ dotnet_diagnostic.S2291.severity = error
255
+ # S2346 [CRITICAL] Flags enumerations zero-value members should be named "None"
256
+ dotnet_diagnostic.S2346.severity = error
257
+ # S2368 [BLOCKER] Public methods should not have multidimensional array parameters
258
+ dotnet_diagnostic.S2368.severity = error
259
+ # S2437 [BLOCKER] Unnecessary bit operations should not be performed
260
+ dotnet_diagnostic.S2437.severity = error
261
+ # S2479 [CRITICAL] Whitespace and control characters in string literals should be explicit
262
+ dotnet_diagnostic.S2479.severity = error
263
+ # S2551 [CRITICAL] Shared resources should not be used for locking
264
+ dotnet_diagnostic.S2551.severity = error
265
+ # S2631 [CRITICAL] Regular expressions should not be vulnerable to Denial of Service attacks
266
+ dotnet_diagnostic.S2631.severity = error
267
+ # S2696 [CRITICAL] Instance members should not write to "static" fields
268
+ dotnet_diagnostic.S2696.severity = error
269
+ # S2699 [BLOCKER] Tests should include assertions
270
+ dotnet_diagnostic.S2699.severity = error
271
+ # S2701 [CRITICAL] Literal boolean values should not be used in assertions
272
+ dotnet_diagnostic.S2701.severity = error
273
+ # S2755 [BLOCKER] XML parsers should not be vulnerable to XXE attacks
274
+ dotnet_diagnostic.S2755.severity = error
275
+ # S2857 [BLOCKER] SQL keywords should be delimited by whitespace
276
+ dotnet_diagnostic.S2857.severity = error
277
+ # S2930 [BLOCKER] "IDisposables" should be disposed
278
+ dotnet_diagnostic.S2930.severity = error
279
+ # S2953 [BLOCKER] Methods named "Dispose" should implement "IDisposable.Dispose"
280
+ dotnet_diagnostic.S2953.severity = error
281
+ # S2970 [BLOCKER] Assertions should be complete
282
+ dotnet_diagnostic.S2970.severity = error
283
+ # S3060 [BLOCKER] "is" should not be used with "this"
284
+ dotnet_diagnostic.S3060.severity = error
285
+ # S3217 [CRITICAL] "Explicit" conversions of "foreach" loops should not be used
286
+ dotnet_diagnostic.S3217.severity = error
287
+ # S3237 [BLOCKER] "value" contextual keyword should be used
288
+ dotnet_diagnostic.S3237.severity = error
289
+ # S3265 [CRITICAL] Non-flags enums should not be used in bitwise operations
290
+ dotnet_diagnostic.S3265.severity = error
291
+ # S3329 [CRITICAL] Cipher Block Chaining IVs should be unpredictable
292
+ dotnet_diagnostic.S3329.severity = error
293
+ # S3427 [BLOCKER] Method overloads with default parameter values should not overlap
294
+ dotnet_diagnostic.S3427.severity = error
295
+ # S3433 [BLOCKER] Test method signatures should be correct
296
+ dotnet_diagnostic.S3433.severity = error
297
+ # S3443 [BLOCKER] Type should not be examined on "System.Type" instances
298
+ dotnet_diagnostic.S3443.severity = error
299
+ # S3447 [CRITICAL] "[Optional]" should not be used on "ref" or "out" parameters
300
+ dotnet_diagnostic.S3447.severity = error
301
+ # S3449 [CRITICAL] Right operands of shift operators should be integers
302
+ dotnet_diagnostic.S3449.severity = error
303
+ # S3451 [CRITICAL] "[DefaultValue]" should not be used when "[DefaultParameterValue]" is meant
304
+ dotnet_diagnostic.S3451.severity = error
305
+ # S3464 [BLOCKER] Type inheritance should not be recursive
306
+ dotnet_diagnostic.S3464.severity = error
307
+ # S3600 [CRITICAL] "params" should not be introduced on overrides
308
+ dotnet_diagnostic.S3600.severity = error
309
+ # S3649 [BLOCKER] Database queries should not be vulnerable to injection attacks
310
+ dotnet_diagnostic.S3649.severity = error
311
+ # S3869 [BLOCKER] "SafeHandle.DangerousGetHandle" should not be called
312
+ dotnet_diagnostic.S3869.severity = error
313
+ # S3877 [BLOCKER] Exceptions should not be thrown from unexpected methods
314
+ dotnet_diagnostic.S3877.severity = error
315
+ # S3889 [BLOCKER] "Thread.Resume" and "Thread.Suspend" should not be used
316
+ dotnet_diagnostic.S3889.severity = error
317
+ # S3904 [CRITICAL] Assemblies should have version information
318
+ dotnet_diagnostic.S3904.severity = error
319
+ # S3972 [CRITICAL] Conditionals should start on new lines
320
+ dotnet_diagnostic.S3972.severity = error
321
+ # S3973 [CRITICAL] A conditionally executed single line should be denoted by indentation
322
+ dotnet_diagnostic.S3973.severity = error
323
+ # S3998 [CRITICAL] Threads should not lock on objects with weak identity
324
+ dotnet_diagnostic.S3998.severity = error
325
+ # S4015 [CRITICAL] Inherited member visibility should not be decreased
326
+ dotnet_diagnostic.S4015.severity = error
327
+ # S4019 [CRITICAL] Base class methods should not be hidden
328
+ dotnet_diagnostic.S4019.severity = error
329
+ # S4159 [BLOCKER] Classes should implement their "ExportAttribute" interfaces
330
+ dotnet_diagnostic.S4159.severity = error
331
+ # S4275 [CRITICAL] Getters and setters should access the expected fields
332
+ dotnet_diagnostic.S4275.severity = error
333
+ # S4277 [CRITICAL] "Shared" parts should not be created with "new"
334
+ dotnet_diagnostic.S4277.severity = error
335
+ # S4347 [CRITICAL] Secure random number generators should not output predictable values
336
+ dotnet_diagnostic.S4347.severity = error
337
+ # S4423 [CRITICAL] Weak SSL/TLS protocols should not be used
338
+ dotnet_diagnostic.S4423.severity = error
339
+ # S4426 [CRITICAL] Cryptographic keys should be robust
340
+ dotnet_diagnostic.S4426.severity = error
341
+ # S4433 [CRITICAL] LDAP connections should be authenticated
342
+ dotnet_diagnostic.S4433.severity = error
343
+ # S4487 [CRITICAL] Unread "private" fields should be removed
344
+ dotnet_diagnostic.S4487.severity = error
345
+ # S4502 [CRITICAL] CSRF protections should not be disabled
346
+ dotnet_diagnostic.S4502.severity = error
347
+ # S4524 [CRITICAL] "default" clauses should be first or last
348
+ dotnet_diagnostic.S4524.severity = error
349
+ # S4583 [CRITICAL] Calls to delegate's method "BeginInvoke" should be paired with calls to "EndInvoke"
350
+ dotnet_diagnostic.S4583.severity = error
351
+ # S4586 [CRITICAL] Non-async "Task/Task<T>" methods should not return null
352
+ dotnet_diagnostic.S4586.severity = error
353
+ # S4635 [CRITICAL] Start index should be used instead of calling Substring
354
+ dotnet_diagnostic.S4635.severity = error
355
+ # S4790 [CRITICAL] Weak hashing algorithms should not be used
356
+ dotnet_diagnostic.S4790.severity = error
357
+ # S4830 [CRITICAL] Server certificates should be verified during SSL/TLS connections
358
+ dotnet_diagnostic.S4830.severity = error
359
+ # S5034 [CRITICAL] "ValueTask" should be consumed correctly
360
+ dotnet_diagnostic.S5034.severity = error
361
+ # S5131 [BLOCKER] Endpoints should not be vulnerable to reflected cross-site scripting (XSS) attacks
362
+ dotnet_diagnostic.S5131.severity = error
363
+ # S5135 [BLOCKER] Deserialization should not be vulnerable to injection attacks
364
+ dotnet_diagnostic.S5135.severity = error
365
+ # S5146 [BLOCKER] HTTP request redirections should not be open to forging attacks
366
+ dotnet_diagnostic.S5146.severity = error
367
+ # S5147 [BLOCKER] NoSQL operations should not be vulnerable to injection attacks
368
+ dotnet_diagnostic.S5147.severity = error
369
+ # S5334 [BLOCKER] Dynamic code execution should not be vulnerable to injection attacks
370
+ dotnet_diagnostic.S5334.severity = error
371
+ # S5344 [CRITICAL] Passwords should not be stored in plaintext or with a fast hashing algorithm
372
+ dotnet_diagnostic.S5344.severity = error
373
+ # S5443 [CRITICAL] Temporary files should not be created in publicly writable directories
374
+ dotnet_diagnostic.S5443.severity = error
375
+ # S5445 [CRITICAL] Insecure temporary file creation methods should not be used
376
+ dotnet_diagnostic.S5445.severity = error
377
+ # S5542 [CRITICAL] Encryption algorithms should be used with secure mode and padding scheme
378
+ dotnet_diagnostic.S5542.severity = error
379
+ # S5547 [CRITICAL] Cipher algorithms should be robust
380
+ dotnet_diagnostic.S5547.severity = error
381
+ # S5659 [CRITICAL] JWT should be signed and verified with strong cipher algorithms
382
+ dotnet_diagnostic.S5659.severity = error
383
+ # S5856 [CRITICAL] Regular expressions should be syntactically valid
384
+ dotnet_diagnostic.S5856.severity = error
385
+ # S6096 [BLOCKER] Extracting archives should not lead to zip slip vulnerabilities
386
+ dotnet_diagnostic.S6096.severity = error
387
+ # S6418 [BLOCKER] Secrets should not be hard-coded
388
+ dotnet_diagnostic.S6418.severity = error
389
+ dotnet_code_quality.S6418.randomnessSensibility = 3
390
+ dotnet_code_quality.S6418.secretWords = api[_\-]?key, auth, credential, secret, token
391
+ # S6422 [BLOCKER] Calls to "async" methods should not be blocking in Azure Functions
392
+ dotnet_diagnostic.S6422.severity = error
393
+ # S6424 [BLOCKER] Interfaces for durable entities should satisfy the restrictions
394
+ dotnet_diagnostic.S6424.severity = error
395
+ # S6674 [CRITICAL] Log message template should be syntactically correct
396
+ dotnet_diagnostic.S6674.severity = error
397
+ # S6680 [CRITICAL] Loop boundaries should not be vulnerable to injection attacks
398
+ dotnet_diagnostic.S6680.severity = error
399
+ # S6781 [BLOCKER] JWT secret keys should not be disclosed
400
+ dotnet_diagnostic.S6781.severity = error
401
+ # S6967 [CRITICAL] ModelState.IsValid should be called in controller actions
402
+ dotnet_diagnostic.S6967.severity = error
403
+ # S7131 [CRITICAL] A write lock should not be released when a read lock has been acquired and vice versa
404
+ dotnet_diagnostic.S7131.severity = error
405
+ # S7133 [CRITICAL] Locks should be released within the same method
406
+ dotnet_diagnostic.S7133.severity = error
407
+ # S8367 [CRITICAL] Identifiers should not conflict with the C# 14 "field" contextual keyword
408
+ dotnet_diagnostic.S8367.severity = error
409
+ # S8368 [CRITICAL] Identifiers should not conflict with the C# 14 "extension" contextual keyword
410
+ dotnet_diagnostic.S8368.severity = error
411
+ # S8380 [CRITICAL] Return types named "partial" should be escaped with "@"
412
+ dotnet_diagnostic.S8380.severity = error
413
+ # S8381 [CRITICAL] "scoped" should be escaped when used as an identifier or type name in parenthesized lambda parameter lists
414
+ dotnet_diagnostic.S8381.severity = error
415
+ # S8717 [BLOCKER] Multiple "[Key]" attributes should not be used to define a composite key
416
+ dotnet_diagnostic.S8717.severity = error
417
+ # S8718 [BLOCKER] Client-evaluated default values should use database functions
418
+ dotnet_diagnostic.S8718.severity = error
419
+ # S9023 [CRITICAL] "Include" calls discarded by query reshaping should be fixed
420
+ dotnet_diagnostic.S9023.severity = error
421
+ # S927 [CRITICAL] Parameter names should match base declaration and other partial definitions
422
+ dotnet_diagnostic.S927.severity = error
423
+
424
+ # Sonar drift Batch D2 (2026-12-03): MAJOR/MINOR/INFO rules pinned at
425
+ # the Sonar profile's expected local severity. Completes the pinning:
426
+ # every mirrorable profile rule is now explicit in the pack.
427
+ # S1066 [MAJOR] Mergeable "if" statements should be combined
428
+ dotnet_diagnostic.S1066.severity = warning
429
+ # S1075 [MINOR] URIs should not be hardcoded
430
+ dotnet_diagnostic.S1075.severity = suggestion
431
+ # S108 [MAJOR] Nested blocks of code should not be left empty
432
+ dotnet_diagnostic.S108.severity = warning
433
+ # S110 [MAJOR] Inheritance tree of classes should not be too deep
434
+ dotnet_diagnostic.S110.severity = warning
435
+ dotnet_code_quality.S110.max = 5
436
+ # S1104 [MINOR] Fields should not have public accessibility
437
+ dotnet_diagnostic.S1104.severity = suggestion
438
+ # S1110 [MAJOR] Redundant pairs of parentheses should be removed
439
+ dotnet_diagnostic.S1110.severity = warning
440
+ # S1116 [MINOR] Empty statements should be removed
441
+ dotnet_diagnostic.S1116.severity = suggestion
442
+ # S1117 [MAJOR] Local variables should not shadow class fields or properties
443
+ dotnet_diagnostic.S1117.severity = warning
444
+ # S1118 [MAJOR] Utility classes should not have public constructors
445
+ dotnet_diagnostic.S1118.severity = warning
446
+ # S112 [MAJOR] General or reserved exceptions should never be thrown
447
+ dotnet_diagnostic.S112.severity = warning
448
+ # S1121 [MAJOR] Assignments should not be made from within sub-expressions
449
+ dotnet_diagnostic.S1121.severity = warning
450
+ # S1123 [MAJOR] "Obsolete" attributes should include explanations
451
+ dotnet_diagnostic.S1123.severity = warning
452
+ # S1125 [MINOR] Boolean literals should not be redundant
453
+ dotnet_diagnostic.S1125.severity = suggestion
454
+ # S1133 [INFO] Deprecated code should be removed
455
+ dotnet_diagnostic.S1133.severity = suggestion
456
+ # S1134 [MAJOR] Track uses of "FIXME" tags
457
+ dotnet_diagnostic.S1134.severity = warning
458
+ # S1144 [MAJOR] Unused private types or members should be removed
459
+ dotnet_diagnostic.S1144.severity = warning
460
+ # S1155 [MINOR] "Any()" should be used to test for emptiness
461
+ dotnet_diagnostic.S1155.severity = suggestion
462
+ # S1168 [MAJOR] Empty arrays and collections should be returned instead of null
463
+ dotnet_diagnostic.S1168.severity = warning
464
+ # S1172 [MAJOR] Unused method parameters should be removed
465
+ dotnet_diagnostic.S1172.severity = warning
466
+ # S1185 [MINOR] Overriding members should do more than simply call the same member in the base class
467
+ dotnet_diagnostic.S1185.severity = suggestion
468
+ # S1199 [MINOR] Nested code blocks should not be used
469
+ dotnet_diagnostic.S1199.severity = suggestion
470
+ # S1206 [MINOR] "Equals(Object)" and "GetHashCode()" should be overridden in pairs
471
+ dotnet_diagnostic.S1206.severity = suggestion
472
+ # S1210 [MINOR] "Equals" and the comparison operators should be overridden when implementing "IComparable"
473
+ dotnet_diagnostic.S1210.severity = suggestion
474
+ # S1244 [MAJOR] Floating point numbers should not be tested for equality
475
+ dotnet_diagnostic.S1244.severity = warning
476
+ # S1313 [MINOR] IP addresses should not be hardcoded
477
+ dotnet_diagnostic.S1313.severity = suggestion
478
+ # S1450 [MINOR] Private fields only used as local variables in methods should become local variables
479
+ dotnet_diagnostic.S1450.severity = suggestion
480
+ # S1479 [MAJOR] "switch" statements with many "case" clauses should have only one statement
481
+ dotnet_diagnostic.S1479.severity = warning
482
+ dotnet_code_quality.S1479.maximum = 30
483
+ # S1607 [MAJOR] Tests should not be ignored
484
+ dotnet_diagnostic.S1607.severity = warning
485
+ # S1643 [MINOR] Strings should not be concatenated using '+' in a loop
486
+ dotnet_diagnostic.S1643.severity = suggestion
487
+ # S1656 [MAJOR] Variables should not be self-assigned
488
+ dotnet_diagnostic.S1656.severity = warning
489
+ # S1694 [MINOR] An abstract class should have both abstract and concrete methods
490
+ dotnet_diagnostic.S1694.severity = suggestion
491
+ # S1696 [MAJOR] NullReferenceException should not be caught
492
+ dotnet_diagnostic.S1696.severity = warning
493
+ # S1764 [MAJOR] Identical expressions should not be used on both sides of operators
494
+ dotnet_diagnostic.S1764.severity = warning
495
+ # S1848 [MAJOR] Objects should not be created to be dropped immediately without being used
496
+ dotnet_diagnostic.S1848.severity = warning
497
+ # S1854 [MAJOR] Unused assignments should be removed
498
+ dotnet_diagnostic.S1854.severity = warning
499
+ # S1862 [MAJOR] Related "if/else if" statements should not have the same condition
500
+ dotnet_diagnostic.S1862.severity = warning
501
+ # S1871 [MAJOR] Two branches in a conditional structure should not have exactly the same implementation
502
+ dotnet_diagnostic.S1871.severity = warning
503
+ # S1905 [MINOR] Redundant casts should not be used
504
+ dotnet_diagnostic.S1905.severity = suggestion
505
+ # S1939 [MINOR] Inheritance list should not be redundant
506
+ dotnet_diagnostic.S1939.severity = suggestion
507
+ # S1940 [MINOR] Boolean checks should not be inverted
508
+ dotnet_diagnostic.S1940.severity = suggestion
509
+ # S2068 [MAJOR] Credentials should not be hard-coded
510
+ dotnet_diagnostic.S2068.severity = warning
511
+ dotnet_code_quality.S2068.credentialWords = password, passwd, pwd, passphrase
512
+ # S2077 [MAJOR] SQL queries should not be dynamically formatted
513
+ dotnet_diagnostic.S2077.severity = warning
514
+ # S2092 [MINOR] Cookies should have the "secure" flag
515
+ dotnet_diagnostic.S2092.severity = suggestion
516
+ # S2094 [MINOR] Classes should not be empty
517
+ dotnet_diagnostic.S2094.severity = suggestion
518
+ # S2114 [MAJOR] Collections should not be passed as arguments to their own methods
519
+ dotnet_diagnostic.S2114.severity = warning
520
+ # S2123 [MAJOR] Values should not be uselessly incremented
521
+ dotnet_diagnostic.S2123.severity = warning
522
+ # S2139 [MAJOR] Exceptions should be either logged or rethrown but not both
523
+ dotnet_diagnostic.S2139.severity = warning
524
+ # S2166 [MAJOR] Classes named like "Exception" should extend "Exception" or a subclass
525
+ dotnet_diagnostic.S2166.severity = warning
526
+ # S2183 [MINOR] Integral numbers should not be shifted by zero or more than their number of bits-1
527
+ dotnet_diagnostic.S2183.severity = suggestion
528
+ # S2184 [MINOR] Results of integer division should not be assigned to floating point variables
529
+ dotnet_diagnostic.S2184.severity = suggestion
530
+ # S2201 [MAJOR] Methods without side effects should not have their return values ignored
531
+ dotnet_diagnostic.S2201.severity = warning
532
+ # S2219 [MINOR] Runtime type checking should be simplified
533
+ dotnet_diagnostic.S2219.severity = suggestion
534
+ # S2225 [MAJOR] "ToString()" method should not return null
535
+ dotnet_diagnostic.S2225.severity = warning
536
+ # S2234 [MAJOR] Arguments should be passed in the same order as the method parameters
537
+ dotnet_diagnostic.S2234.severity = warning
538
+ # S2251 [MAJOR] A "for" loop update clause should move the counter in the right direction
539
+ dotnet_diagnostic.S2251.severity = warning
540
+ # S2252 [MAJOR] For-loop conditions should be true at least once
541
+ dotnet_diagnostic.S2252.severity = warning
542
+ # S2259 [MAJOR] Null pointers should not be dereferenced
543
+ dotnet_diagnostic.S2259.severity = warning
544
+ # S2292 [MINOR] Trivial properties should be auto-implemented
545
+ dotnet_diagnostic.S2292.severity = suggestion
546
+ # S2325 [MINOR] Methods and properties that don't access instance data should be static
547
+ dotnet_diagnostic.S2325.severity = suggestion
548
+ # S2328 [MINOR] "GetHashCode" should not reference mutable fields
549
+ dotnet_diagnostic.S2328.severity = suggestion
550
+ # S2342 [MINOR] Enumeration types should comply with a naming convention
551
+ dotnet_diagnostic.S2342.severity = suggestion
552
+ dotnet_code_quality.S2342.format = ^([A-Z]{1,3}[a-z0-9]+)*([A-Z]{2})?$
553
+ dotnet_code_quality.S2342.flagsAttributeFormat = ^([A-Z]{1,3}[a-z0-9]+)*([A-Z]{2})?s$
554
+ # S2344 [MINOR] Enumeration type names should not have "Flags" or "Enum" suffixes
555
+ dotnet_diagnostic.S2344.severity = suggestion
556
+ # S2345 [MINOR] Flags enumerations should explicitly initialize all their members
557
+ dotnet_diagnostic.S2345.severity = suggestion
558
+ # S2372 [MAJOR] Exceptions should not be thrown from property getters
559
+ dotnet_diagnostic.S2372.severity = warning
560
+ # S2376 [MAJOR] Write-only properties should not be used
561
+ dotnet_diagnostic.S2376.severity = warning
562
+ # S2386 [MINOR] Mutable fields should not be "public static"
563
+ dotnet_diagnostic.S2386.severity = suggestion
564
+ # S2445 [MAJOR] Blocks should be synchronized on read-only fields
565
+ dotnet_diagnostic.S2445.severity = warning
566
+ # S2486 [MINOR] Generic exceptions should not be ignored
567
+ dotnet_diagnostic.S2486.severity = suggestion
568
+ # S2612 [MAJOR] File permissions should not be set to world-accessible values
569
+ dotnet_diagnostic.S2612.severity = warning
570
+ # S2629 [MAJOR] Logging templates should be constant
571
+ dotnet_diagnostic.S2629.severity = warning
572
+ # S2674 [MINOR] The length returned from a stream read should be checked
573
+ dotnet_diagnostic.S2674.severity = suggestion
574
+ # S2681 [MAJOR] Multiline blocks should be enclosed in curly braces
575
+ dotnet_diagnostic.S2681.severity = warning
576
+ # S2688 [MAJOR] "NaN" should not be used in comparisons
577
+ dotnet_diagnostic.S2688.severity = warning
578
+ # S2737 [MINOR] "catch" clauses should do more than rethrow
579
+ dotnet_diagnostic.S2737.severity = suggestion
580
+ # S2757 [MAJOR] Non-existent operators like "=+" should not be used
581
+ dotnet_diagnostic.S2757.severity = warning
582
+ # S2761 [MAJOR] Doubled prefix operators "!!" and "~~" should not be used
583
+ dotnet_diagnostic.S2761.severity = warning
584
+ # S2925 [MAJOR] "Thread.Sleep" should not be used in tests
585
+ dotnet_diagnostic.S2925.severity = warning
586
+ # S2933 [MAJOR] Fields that are only assigned in the constructor should be "readonly"
587
+ dotnet_diagnostic.S2933.severity = warning
588
+ # S2934 [MINOR] Property assignments should not be made for "readonly" fields not constrained to reference types
589
+ dotnet_diagnostic.S2934.severity = suggestion
590
+ # S2955 [MINOR] Generic parameters not constrained to reference types should not be compared to "null"
591
+ dotnet_diagnostic.S2955.severity = suggestion
592
+ # S2971 [MAJOR] LINQ expressions should be simplified
593
+ dotnet_diagnostic.S2971.severity = warning
594
+ # S2995 [MAJOR] "Object.ReferenceEquals" should not be used for value types
595
+ dotnet_diagnostic.S2995.severity = warning
596
+ # S2996 [MAJOR] "ThreadStatic" fields should not be initialized
597
+ dotnet_diagnostic.S2996.severity = warning
598
+ # S2997 [MAJOR] "IDisposables" created in a "using" statement should not be returned
599
+ dotnet_diagnostic.S2997.severity = warning
600
+ # S3005 [MAJOR] "ThreadStatic" should not be used on non-static fields
601
+ dotnet_diagnostic.S3005.severity = warning
602
+ # S3010 [MAJOR] Static fields should not be updated in constructors
603
+ dotnet_diagnostic.S3010.severity = warning
604
+ # S3063 [MAJOR] "StringBuilder" data should be used
605
+ dotnet_diagnostic.S3063.severity = warning
606
+ # S3168 [MAJOR] "async" methods should not return "void"
607
+ dotnet_diagnostic.S3168.severity = warning
608
+ # S3169 [MAJOR] Multiple "OrderBy" calls should not be used
609
+ dotnet_diagnostic.S3169.severity = warning
610
+ # S3172 [MAJOR] Delegates should not be subtracted
611
+ dotnet_diagnostic.S3172.severity = warning
612
+ # S3236 [MINOR] Caller information arguments should not be provided explicitly
613
+ dotnet_diagnostic.S3236.severity = suggestion
614
+ # S3241 [MINOR] Methods should not return values that are never used
615
+ dotnet_diagnostic.S3241.severity = suggestion
616
+ # S3244 [MAJOR] Anonymous delegates should not be used to unsubscribe from Events
617
+ dotnet_diagnostic.S3244.severity = warning
618
+ # S3246 [MAJOR] Generic type parameters should be co/contravariant when possible
619
+ dotnet_diagnostic.S3246.severity = warning
620
+ # S3247 [MINOR] Duplicate casts should not be made
621
+ dotnet_diagnostic.S3247.severity = suggestion
622
+ # S3251 [MINOR] Implementations should be provided for "partial" methods
623
+ dotnet_diagnostic.S3251.severity = suggestion
624
+ # S3260 [MINOR] Non-derived "private" classes and records should be "sealed"
625
+ dotnet_diagnostic.S3260.severity = suggestion
626
+ # S3261 [MINOR] Namespaces should not be empty
627
+ dotnet_diagnostic.S3261.severity = suggestion
628
+ # S3262 [MAJOR] "params" should be used on overrides
629
+ dotnet_diagnostic.S3262.severity = warning
630
+ # S3263 [MAJOR] Static fields should appear in the order they must be initialized
631
+ dotnet_diagnostic.S3263.severity = warning
632
+ # S3264 [MAJOR] Events should be invoked
633
+ dotnet_diagnostic.S3264.severity = warning
634
+ # S3330 [MINOR] Cookies should have the "HttpOnly" flag
635
+ dotnet_diagnostic.S3330.severity = suggestion
636
+ # S3343 [MAJOR] Caller information parameters should come at the end of the parameter list
637
+ dotnet_diagnostic.S3343.severity = warning
638
+ # S3346 [MAJOR] Expressions used in "Debug.Assert" should not produce side effects
639
+ dotnet_diagnostic.S3346.severity = warning
640
+ # S3363 [MINOR] Date and time should not be used as a type for primary keys
641
+ dotnet_diagnostic.S3363.severity = suggestion
642
+ # S3376 [MINOR] Attribute, EventArgs, and Exception type names should end with the type being extended
643
+ dotnet_diagnostic.S3376.severity = suggestion
644
+ # S3397 [MINOR] "base.Equals" should not be used to check for reference equality in "Equals" if "base" is not "object"
645
+ dotnet_diagnostic.S3397.severity = suggestion
646
+ # S3400 [MINOR] Methods should not return constants
647
+ dotnet_diagnostic.S3400.severity = suggestion
648
+ # S3415 [MAJOR] Assertion arguments should be passed in the correct order
649
+ dotnet_diagnostic.S3415.severity = warning
650
+ # S3431 [MAJOR] "[ExpectedException]" should not be used
651
+ dotnet_diagnostic.S3431.severity = warning
652
+ # S3440 [MINOR] Variables should not be checked against the values they're about to be assigned
653
+ dotnet_diagnostic.S3440.severity = suggestion
654
+ # S3442 [MAJOR] "abstract" classes should not have "public" constructors
655
+ dotnet_diagnostic.S3442.severity = warning
656
+ # S3444 [MINOR] Interfaces should not simply inherit from base interfaces with colliding members
657
+ dotnet_diagnostic.S3444.severity = suggestion
658
+ # S3445 [MAJOR] Exceptions should not be explicitly rethrown
659
+ dotnet_diagnostic.S3445.severity = warning
660
+ # S3450 [MINOR] Parameters with "[DefaultParameterValue]" attributes should also be marked "[Optional]"
661
+ dotnet_diagnostic.S3450.severity = suggestion
662
+ # S3453 [MAJOR] Classes should not have only "private" constructors
663
+ dotnet_diagnostic.S3453.severity = warning
664
+ # S3456 [MINOR] "string.ToCharArray()" and "ReadOnlySpan<T>.ToArray()" should not be called redundantly
665
+ dotnet_diagnostic.S3456.severity = suggestion
666
+ # S3457 [MAJOR] Composite format strings should be used correctly
667
+ dotnet_diagnostic.S3457.severity = warning
668
+ # S3458 [MINOR] Empty "case" clauses that fall through to the "default" should be omitted
669
+ dotnet_diagnostic.S3458.severity = suggestion
670
+ # S3459 [MINOR] Unassigned members should be removed
671
+ dotnet_diagnostic.S3459.severity = suggestion
672
+ # S3466 [MAJOR] Optional parameters should be passed to "base" calls
673
+ dotnet_diagnostic.S3466.severity = warning
674
+ # S3597 [MAJOR] "ServiceContract" and "OperationContract" attributes should be used together
675
+ dotnet_diagnostic.S3597.severity = warning
676
+ # S3598 [MAJOR] One-way "OperationContract" methods should have "void" return type
677
+ dotnet_diagnostic.S3598.severity = warning
678
+ # S3603 [MAJOR] Methods with "Pure" attribute should return a value
679
+ dotnet_diagnostic.S3603.severity = warning
680
+ # S3610 [MAJOR] Nullable type comparison should not be redundant
681
+ dotnet_diagnostic.S3610.severity = warning
682
+ # S3626 [MINOR] Jump statements should not be redundant
683
+ dotnet_diagnostic.S3626.severity = suggestion
684
+ # S3655 [MAJOR] Empty nullable value should not be accessed
685
+ dotnet_diagnostic.S3655.severity = warning
686
+ # S3881 [MAJOR] "IDisposable" should be implemented correctly
687
+ dotnet_diagnostic.S3881.severity = warning
688
+ # S3887 [MINOR] Mutable, non-private fields should not be "readonly"
689
+ dotnet_diagnostic.S3887.severity = suggestion
690
+ # S3897 [MINOR] Classes that provide "Equals(<T>)" should implement "IEquatable<T>"
691
+ dotnet_diagnostic.S3897.severity = suggestion
692
+ # S3903 [MAJOR] Types should be defined in named namespaces
693
+ dotnet_diagnostic.S3903.severity = warning
694
+ # S3923 [MAJOR] All branches in a conditional structure should not have exactly the same implementation
695
+ dotnet_diagnostic.S3923.severity = warning
696
+ # S3925 [MAJOR] "ISerializable" should be implemented correctly
697
+ dotnet_diagnostic.S3925.severity = warning
698
+ # S3926 [MAJOR] Deserialization methods should be provided for "OptionalField" members
699
+ dotnet_diagnostic.S3926.severity = warning
700
+ # S3927 [MAJOR] Serialization event handlers should be implemented correctly
701
+ dotnet_diagnostic.S3927.severity = warning
702
+ # S3928 [MAJOR] Parameter names used into ArgumentException constructors should match an existing one
703
+ dotnet_diagnostic.S3928.severity = warning
704
+ # S3949 [MAJOR] Calculations should not overflow
705
+ dotnet_diagnostic.S3949.severity = warning
706
+ # S3963 [MINOR] "static" fields should be initialized inline
707
+ dotnet_diagnostic.S3963.severity = suggestion
708
+ # S3966 [MAJOR] Objects should not be disposed more than once
709
+ dotnet_diagnostic.S3966.severity = warning
710
+ # S3971 [MAJOR] "GC.SuppressFinalize" should not be called
711
+ dotnet_diagnostic.S3971.severity = warning
712
+ # S3981 [MAJOR] Collection sizes and array length comparisons should make sense
713
+ dotnet_diagnostic.S3981.severity = warning
714
+ # S3984 [MAJOR] Exceptions should not be created without being thrown
715
+ dotnet_diagnostic.S3984.severity = warning
716
+ # S3993 [MAJOR] Custom attributes should be marked with "System.AttributeUsageAttribute"
717
+ dotnet_diagnostic.S3993.severity = warning
718
+ # S4036 [MINOR] OS commands should not rely on PATH resolution
719
+ dotnet_diagnostic.S4036.severity = suggestion
720
+ # S4050 [MAJOR] Operators should be overloaded consistently
721
+ dotnet_diagnostic.S4050.severity = warning
722
+ # S4052 [MINOR] Types should not extend outdated base types
723
+ dotnet_diagnostic.S4052.severity = suggestion
724
+ # S4061 [MINOR] "params" should be used instead of "varargs"
725
+ dotnet_diagnostic.S4061.severity = suggestion
726
+ # S4070 [MAJOR] Non-flags enums should not be marked with "FlagsAttribute"
727
+ dotnet_diagnostic.S4070.severity = warning
728
+ # S4143 [MAJOR] Collection elements should not be replaced unconditionally
729
+ dotnet_diagnostic.S4143.severity = warning
730
+ # S4144 [MAJOR] Methods should not have identical implementations
731
+ dotnet_diagnostic.S4144.severity = warning
732
+ # S4158 [MINOR] Empty collections should not be accessed or iterated
733
+ dotnet_diagnostic.S4158.severity = suggestion
734
+ # S4200 [MAJOR] Native methods should be wrapped
735
+ dotnet_diagnostic.S4200.severity = warning
736
+ # S4201 [MINOR] Null checks should not be combined with "is" operator checks
737
+ dotnet_diagnostic.S4201.severity = suggestion
738
+ # S4210 [MAJOR] Windows Forms entry points should be marked with STAThread
739
+ dotnet_diagnostic.S4210.severity = warning
740
+ # S4211 [MAJOR] Members should not have conflicting transparency annotations
741
+ dotnet_diagnostic.S4211.severity = warning
742
+ # S4220 [MAJOR] Events should have proper arguments
743
+ dotnet_diagnostic.S4220.severity = warning
744
+ # S4260 [MAJOR] "ConstructorArgument" parameters should exist in constructors
745
+ dotnet_diagnostic.S4260.severity = warning
746
+ # S4428 [MAJOR] "PartCreationPolicyAttribute" should be used with "ExportAttribute"
747
+ dotnet_diagnostic.S4428.severity = warning
748
+ # S4456 [MAJOR] Parameter validation in yielding methods should be wrapped
749
+ dotnet_diagnostic.S4456.severity = warning
750
+ # S4507 [MINOR] Debugging features should not be enabled in production
751
+ dotnet_diagnostic.S4507.severity = suggestion
752
+ # S4545 [MAJOR] "DebuggerDisplayAttribute" strings should reference existing members
753
+ dotnet_diagnostic.S4545.severity = warning
754
+ # S4581 [MAJOR] "new Guid()" should not be used
755
+ dotnet_diagnostic.S4581.severity = warning
756
+ # S4663 [MINOR] Comments should not be empty
757
+ dotnet_diagnostic.S4663.severity = suggestion
758
+ # S5122 [MAJOR] Cross-Origin Resource Sharing (CORS) policy should be restricted to trusted origins
759
+ dotnet_diagnostic.S5122.severity = warning
760
+ # S5144 [MAJOR] Server-side requests should not be vulnerable to forging attacks
761
+ dotnet_diagnostic.S5144.severity = warning
762
+ # S5145 [MINOR] Logging should not be vulnerable to injection attacks
763
+ dotnet_diagnostic.S5145.severity = suggestion
764
+ # S5332 [MINOR] Clear-text protocols should not be used
765
+ dotnet_diagnostic.S5332.severity = suggestion
766
+ # S5693 [MAJOR] HTTP request content length should be limited
767
+ dotnet_diagnostic.S5693.severity = warning
768
+ dotnet_code_quality.S5693.fileUploadSizeLimit = 8388608
769
+ # S5753 [MAJOR] ASP.NET Request Validation should not be disabled
770
+ dotnet_diagnostic.S5753.severity = warning
771
+ # S5766 [MAJOR] Serializable objects should validate data during deserialization
772
+ dotnet_diagnostic.S5766.severity = warning
773
+ # S5773 [MAJOR] Types allowed to be deserialized should be restricted
774
+ dotnet_diagnostic.S5773.severity = warning
775
+ # S5883 [MINOR] OS commands should not be vulnerable to argument injection attacks
776
+ dotnet_diagnostic.S5883.severity = suggestion
777
+ # S6173 [MAJOR] Reflection should not be vulnerable to injection attacks
778
+ dotnet_diagnostic.S6173.severity = warning
779
+ # S6287 [MAJOR] Applications should not create session cookies from untrusted input
780
+ dotnet_diagnostic.S6287.severity = warning
781
+ # S6350 [MAJOR] System command arguments constructed from user input should be validated
782
+ dotnet_diagnostic.S6350.severity = warning
783
+ # S6377 [MAJOR] XML signatures should be validated securely
784
+ dotnet_diagnostic.S6377.severity = warning
785
+ # S6399 [MAJOR] XML operations should not be vulnerable to injection attacks
786
+ dotnet_diagnostic.S6399.severity = warning
787
+ # S6419 [MAJOR] Azure Functions should be stateless
788
+ dotnet_diagnostic.S6419.severity = warning
789
+ # S6420 [MAJOR] Client instances should not be recreated on each Azure Function invocation
790
+ dotnet_diagnostic.S6420.severity = warning
791
+ # S6547 [MAJOR] Environment variables should not be defined from untrusted input
792
+ dotnet_diagnostic.S6547.severity = warning
793
+ # S6549 [MAJOR] Accessing files should not lead to filesystem oracle attacks
794
+ dotnet_diagnostic.S6549.severity = warning
795
+ # S6561 [MAJOR] Avoid using "DateTime.Now" for benchmarking or timing operations
796
+ dotnet_diagnostic.S6561.severity = warning
797
+ # S6575 [MAJOR] Use "TimeZoneInfo.FindSystemTimeZoneById" without converting the timezones with "TimezoneConverter"
798
+ dotnet_diagnostic.S6575.severity = warning
799
+ # S6580 [MAJOR] Use a format provider when parsing date and time
800
+ dotnet_diagnostic.S6580.severity = warning
801
+ # S6588 [MINOR] Use the "UnixEpoch" field instead of creating "DateTime" instances that point to the beginning of the Unix epoch
802
+ dotnet_diagnostic.S6588.severity = suggestion
803
+ # S6607 [MINOR] The collection should be filtered before sorting by using "Where" before "OrderBy"
804
+ dotnet_diagnostic.S6607.severity = suggestion
805
+ # S6608 [MINOR] Prefer indexing instead of "Enumerable" methods on types implementing "IList"
806
+ dotnet_diagnostic.S6608.severity = suggestion
807
+ # S6609 [MINOR] "Min/Max" properties of "Set" types should be used instead of the "Enumerable" extension methods
808
+ dotnet_diagnostic.S6609.severity = suggestion
809
+ # S6610 [MINOR] "StartsWith" and "EndsWith" overloads that take a "char" should be used instead of the ones that take a "string"
810
+ dotnet_diagnostic.S6610.severity = suggestion
811
+ # S6612 [MINOR] The lambda parameter should be used instead of capturing arguments in "ConcurrentDictionary" methods
812
+ dotnet_diagnostic.S6612.severity = suggestion
813
+ # S6613 [MINOR] "First" and "Last" properties of "LinkedList" should be used instead of the "First()" and "Last()" extension methods
814
+ dotnet_diagnostic.S6613.severity = suggestion
815
+ # S6617 [MINOR] "Contains" should be used instead of "Any" for simple equality checks
816
+ dotnet_diagnostic.S6617.severity = suggestion
817
+ # S6618 [MINOR] "string.Create" should be used instead of "FormattableString"
818
+ dotnet_diagnostic.S6618.severity = suggestion
819
+ # S6639 [MAJOR] Memory allocations should not be vulnerable to Denial of Service attacks
820
+ dotnet_diagnostic.S6639.severity = warning
821
+ # S6640 [MAJOR] Unsafe code blocks should not be used
822
+ dotnet_diagnostic.S6640.severity = warning
823
+ # S6641 [MAJOR] Connection strings should not be vulnerable to injection attacks
824
+ dotnet_diagnostic.S6641.severity = warning
825
+ # S6664 [MINOR] The code block contains too many logging calls
826
+ dotnet_diagnostic.S6664.severity = suggestion
827
+ dotnet_code_quality.S6664.warningThreshold = 1
828
+ dotnet_code_quality.S6664.informationThreshold = 2
829
+ dotnet_code_quality.S6664.errorThreshold = 1
830
+ dotnet_code_quality.S6664.debugThreshold = 4
831
+ # S6667 [MINOR] Logging in a catch clause should pass the caught exception as a parameter.
832
+ dotnet_diagnostic.S6667.severity = suggestion
833
+ # S6668 [MINOR] Logging arguments should be passed to the correct parameter
834
+ dotnet_diagnostic.S6668.severity = suggestion
835
+ # S6669 [MINOR] Logger field or property name should comply with a naming convention
836
+ dotnet_diagnostic.S6669.severity = suggestion
837
+ dotnet_code_quality.S6669.format = ^_?[Ll]og(ger)?$
838
+ # S6673 [MAJOR] Log message template placeholders should be in the right order
839
+ dotnet_diagnostic.S6673.severity = warning
840
+ # S6675 [MINOR] "Trace.WriteLineIf" should not be used with "TraceSwitch" levels
841
+ dotnet_diagnostic.S6675.severity = suggestion
842
+ # S6677 [MAJOR] Message template placeholders should be unique
843
+ dotnet_diagnostic.S6677.severity = warning
844
+ # S6678 [MINOR] Use PascalCase for named placeholders
845
+ dotnet_diagnostic.S6678.severity = suggestion
846
+ # S6776 [MINOR] Stack traces should not be disclosed
847
+ dotnet_diagnostic.S6776.severity = suggestion
848
+ # S6797 [MAJOR] Blazor query parameter type should be supported
849
+ dotnet_diagnostic.S6797.severity = warning
850
+ # S6798 [MAJOR] [JSInvokable] attribute should only be used on public methods
851
+ dotnet_diagnostic.S6798.severity = warning
852
+ # S6800 [MAJOR] Component parameter type should match the route parameter type constraint
853
+ dotnet_diagnostic.S6800.severity = warning
854
+ # S6930 [MAJOR] Backslash should be avoided in route templates
855
+ dotnet_diagnostic.S6930.severity = warning
856
+ # S6931 [MAJOR] ASP.NET controller actions should not have a route template starting with "/"
857
+ dotnet_diagnostic.S6931.severity = warning
858
+ # S6932 [MAJOR] Use model binding instead of reading raw request data
859
+ dotnet_diagnostic.S6932.severity = warning
860
+ # S6934 [MAJOR] A Route attribute should be added to the controller when a route template is specified at the action level
861
+ dotnet_diagnostic.S6934.severity = warning
862
+ # S6960 [MAJOR] Controllers should not have mixed responsibilities
863
+ dotnet_diagnostic.S6960.severity = warning
864
+ # S6961 [MAJOR] API Controllers should derive from ControllerBase instead of Controller
865
+ dotnet_diagnostic.S6961.severity = warning
866
+ # S6962 [MAJOR] You should pool HTTP connections with HttpClientFactory
867
+ dotnet_diagnostic.S6962.severity = warning
868
+ # S6964 [MAJOR] Value type property used as input in a controller action should be nullable, required or annotated with the JsonRequiredAttribute to avoid under-posting.
869
+ dotnet_diagnostic.S6964.severity = warning
870
+ # S6965 [MAJOR] REST API actions should be annotated with an HTTP verb attribute
871
+ dotnet_diagnostic.S6965.severity = warning
872
+ # S6968 [MAJOR] Actions that return a value should be annotated with ProducesResponseTypeAttribute containing the return type
873
+ dotnet_diagnostic.S6968.severity = warning
874
+ # S7039 [MAJOR] Content Security Policies should be restrictive
875
+ dotnet_diagnostic.S7039.severity = warning
876
+ # S7044 [MAJOR] Server-side requests should not be vulnerable to traversing attacks
877
+ dotnet_diagnostic.S7044.severity = warning
878
+ # S7130 [MAJOR] First/Single should be used instead of FirstOrDefault/SingleOrDefault on collections that are known to be non-empty
879
+ dotnet_diagnostic.S7130.severity = warning
880
+ # S7714 [MAJOR] XSLT Transformations should not be vulnerable to injection attacks
881
+ dotnet_diagnostic.S7714.severity = warning
882
+ # S818 [MINOR] Literal suffixes should be upper case
883
+ dotnet_diagnostic.S818.severity = suggestion
884
+ # S8733 [MAJOR] Potential Cartesian Explosion
885
+ dotnet_diagnostic.S8733.severity = warning
886
+ # S8747 [MAJOR] Migrations should not narrow column types without converting existing data
887
+ dotnet_diagnostic.S8747.severity = warning
888
+ # S8949 [MAJOR] The overload accepting a 'CancellationToken' should be used
889
+ dotnet_diagnostic.S8949.severity = warning
890
+ # S8970 [MINOR] Null-forgiving operators should not be used when nullable warnings are disabled
891
+ dotnet_diagnostic.S8970.severity = suggestion
892
+ # S9022 [MINOR] Redundant "Include" calls should be removed
893
+ dotnet_diagnostic.S9022.severity = suggestion
894
+ # S907 [MAJOR] "goto" statement should not be used
895
+ dotnet_diagnostic.S907.severity = warning
896
+ # S9118 [MAJOR] Default values should be compatible with their entity property type
897
+ dotnet_diagnostic.S9118.severity = warning
898
+ # S9129 [MINOR] "Include" and "ThenInclude" chains of reference navigations should be merged into a single "Include" call
899
+ dotnet_diagnostic.S9129.severity = suggestion