chore(sonar)!: mark public Markdown generator methods static (CA1822)
SonarQube Analysis / sonarqube (pull_request) Successful in 3m30s
SonarQube Analysis / sonarqube (pull_request) Successful in 3m30s
Three public methods on the SqlServer-namespaced Markdown generators no longer touch instance state and now carry the `static` keyword: - `Markdown.SqlServer.QueryBreakdownGenerator.GenerateMermaidDiagram(QueryBreakdown, string?)` - `Markdown.SqlServer.SqlStatementGenerator.GenerateSequenceDiagram(ISqlBreakdown, string?)` - `Markdown.SqlServer.SqlStatementGenerator.GenerateEntityRelationshipDiagram(IEnumerable<string>, string?)` Plus one private bonus the analyzer caught on the same pass: - `LinqExpressionVisitor.ExtractSelectExpression` → static (non-breaking). Internal callers in the Snowflake/LinqToSql/PostgreSql wrapper classes and in the test fixtures are updated to the type-name form (`SqlServer.SqlStatementGenerator.GenerateSequenceDiagram(...)`). The wrappers retain their `_baseGenerator` field for now even though it is no longer used — that S4487 / unused-field cleanup is its own commit. BREAKING CHANGE: External NuGet consumers calling `generatorInstance.GenerateMermaidDiagram(...)`, `generatorInstance.GenerateSequenceDiagram(...)`, or `generatorInstance.GenerateEntityRelationshipDiagram(...)` on the SqlServer-namespaced generators must switch to type-name form, e.g. `Markdown.SqlServer.SqlStatementGenerator.GenerateSequenceDiagram(...)`. Calls through the Snowflake / LinqToSql / PostgreSql wrapper classes are unaffected at the call site. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.7
parent
3c602a4625
commit
5202d93e8e
@@ -59,7 +59,7 @@ public class QueryMarkdownGenerationTests
|
||||
var queryBreakdown = QueryBreakdown.Parse(sqlContent);
|
||||
|
||||
// Generate markdown with the filename as title
|
||||
var markdown = _generator.GenerateMermaidDiagram(queryBreakdown, fileName);
|
||||
var markdown = QueryBreakdownGenerator.GenerateMermaidDiagram(queryBreakdown, fileName);
|
||||
|
||||
// Verify markdown was generated
|
||||
Assert.That(markdown, Is.Not.Null);
|
||||
@@ -107,7 +107,7 @@ public class QueryMarkdownGenerationTests
|
||||
try
|
||||
{
|
||||
var queryBreakdown = QueryBreakdown.Parse(sqlContent);
|
||||
var markdown = _generator.GenerateMermaidDiagram(queryBreakdown, fileName);
|
||||
var markdown = QueryBreakdownGenerator.GenerateMermaidDiagram(queryBreakdown, fileName);
|
||||
|
||||
// Add source SQL to the markdown
|
||||
var fullMarkdown = $"{markdown}\n\n## Source SQL\n\n```sql\n{sqlContent}\n```\n";
|
||||
|
||||
Reference in New Issue
Block a user