Conversation
…s into AnalysisOptions
Contributor
There was a problem hiding this comment.
Pull request overview
This PR refactors the ClassDiagram analysis API to address a SonarQube code smell about having too many method parameters. The changes consolidate five optional parameters (includeInheritance, includeDependencies, includeProperties, includeFunctions, maxDepth) into a single AnalysisOptions record parameter.
Changes:
- Converted
AnalysisOptionsfrom a class with required properties to a record with default parameter values - Refactored
IClassAnalysisService.AnalyzeFileAsyncand related methods to accept anAnalysisOptions?parameter instead of multiple boolean/int parameters - Updated MCP tool interface to use the new options parameter with appropriate descriptions for API documentation
- Updated all call sites across unit tests, integration tests, and contract tests to use the new signature
Reviewed changes
Copilot reviewed 13 out of 13 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| src/ProjGraph.Lib.ClassDiagram/Application/AnalysisOptions.cs | Converted from class to record with default parameter values and Description attributes |
| src/ProjGraph.Lib.ClassDiagram/Application/IClassAnalysisService.cs | Simplified signature to accept single AnalysisOptions parameter |
| src/ProjGraph.Lib.ClassDiagram/Application/ClassAnalysisService.cs | Updated implementation to pass options to use case |
| src/ProjGraph.Lib.ClassDiagram/Application/UseCases/AnalyzeFileUseCase.cs | Updated to accept options parameter with null-coalescing default |
| src/ProjGraph.Mcp/Program.cs | Updated MCP tool to accept AnalysisOptions parameter with Description attribute |
| src/ProjGraph.Cli/Commands/ClassDiagramCommand.cs | Updated CLI command to construct AnalysisOptions from settings |
| tests/ProjGraph.Tests.Contract/McpClassDiagramTests.cs | Updated contract tests to verify new MCP signature |
| tests/ProjGraph.Tests.Unit.ClassDiagram/*.cs | Updated unit tests to use new AnalysisOptions constructor |
| tests/ProjGraph.Tests.Integration.Mcp/McpClassDiagramTests.cs | Updated integration tests with AnalysisOptions instances |
| specs/004-config-class-members/data-model.md | Whitespace/formatting cleanup |
| CONTRIBUTING.md | Removed NullOutputConsole from shared helpers list (no longer exists) |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request refactors the way analysis options are handled for class diagram generation, consolidating multiple boolean and integer parameters into a single
AnalysisOptionsrecord. This change simplifies the API surface, improves maintainability, and updates all relevant code, documentation, and tests to use the new approach. Additionally, the CodeQL workflow is streamlined to use autobuild instead of manual build steps.API and Codebase Refactoring:
includeInheritance,includeDependencies,includeProperties,includeFunctions,depth) with a singleAnalysisOptionsrecord in theIClassAnalysisService,ClassAnalysisService,AnalyzeFileUseCase, and public CLI/MCP interfaces. All usages and XML documentation are updated accordingly. [1] [2] [3] [4] [5] [6] [7] [8]AnalysisOptionsparameter, removing checks for the old individual flags and adding checks for the new record. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10]Documentation Updates:
CONTRIBUTING.mdandspecs/004-config-class-members/data-model.mdto reflect the newAnalysisOptionsstructure and correct table formatting. [1] [2] [3]Workflow Improvements:
autobuildand removing the explicit build step.pull_requesttrigger from the CodeQL workflow schedule.