Skip to content

Commit b4387d1

Browse files
Copilotstephentoub
andcommitted
Regenerate auto-generated documentation files for CA2026
Co-authored-by: stephentoub <[email protected]>
1 parent 90c105e commit b4387d1

File tree

2 files changed

+32
-0
lines changed

2 files changed

+32
-0
lines changed

src/Microsoft.CodeAnalysis.NetAnalyzers/src/Microsoft.CodeAnalysis.NetAnalyzers.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2154,6 +2154,18 @@ Unawaited tasks that use 'IDisposable' instances may use those instances long af
21542154
|CodeFix|False|
21552155
---
21562156

2157+
## [CA2026](https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca2026): Prefer JsonElement.Parse over JsonDocument.Parse().RootElement
2158+
2159+
JsonDocument implements IDisposable and needs to be properly disposed. When only the RootElement is needed, prefer JsonElement.Parse which doesn't require disposal.
2160+
2161+
|Item|Value|
2162+
|-|-|
2163+
|Category|Reliability|
2164+
|Enabled|True|
2165+
|Severity|Info|
2166+
|CodeFix|True|
2167+
---
2168+
21572169
## [CA2100](https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca2100): Review SQL queries for security vulnerabilities
21582170

21592171
SQL queries that directly use user input can be vulnerable to SQL injection attacks. Review this SQL query for potential vulnerabilities, and consider using a parameterized SQL query.

src/Microsoft.CodeAnalysis.NetAnalyzers/src/Microsoft.CodeAnalysis.NetAnalyzers.sarif

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3850,6 +3850,26 @@
38503850
]
38513851
}
38523852
},
3853+
"CA2026": {
3854+
"id": "CA2026",
3855+
"shortDescription": "Prefer JsonElement.Parse over JsonDocument.Parse().RootElement",
3856+
"fullDescription": "JsonDocument implements IDisposable and needs to be properly disposed. When only the RootElement is needed, prefer JsonElement.Parse which doesn't require disposal.",
3857+
"defaultLevel": "note",
3858+
"helpUri": "https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca2026",
3859+
"properties": {
3860+
"category": "Reliability",
3861+
"isEnabledByDefault": true,
3862+
"typeName": "PreferJsonElementParse",
3863+
"languages": [
3864+
"C#",
3865+
"Visual Basic"
3866+
],
3867+
"tags": [
3868+
"Telemetry",
3869+
"EnabledRuleInAggressiveMode"
3870+
]
3871+
}
3872+
},
38533873
"CA2100": {
38543874
"id": "CA2100",
38553875
"shortDescription": "Review SQL queries for security vulnerabilities",

0 commit comments

Comments
 (0)