-
Notifications
You must be signed in to change notification settings - Fork 0
/
CA2153.yaml
36 lines (36 loc) · 833 Bytes
/
CA2153.yaml
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
rules:
- id: CA2153
severity: WARNING
languages:
- csharp
message: Avoid handling Corrupted State Exceptions
metadata:
cwe: "CWE-755: Improper Handling of Exceptional Conditions"
references:
- https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca2153
patterns:
- pattern-inside: |
[HandleProcessCorruptedStateExceptions]
$T $F(...){
...
}
- pattern: |
try
{
...
}
catch (Exception e)
{
...
}
- pattern-not-inside: |
try
{
...
}
catch (Exception e)
{
...
throw;
...
}