Skip to content

Conversation

@nquinquenel
Copy link
Member

@nquinquenel nquinquenel commented Sep 9, 2025

MCP-106

Thanks #85 @rishichintala for the report

Copy link
Contributor

@damien-urruty-sonarsource damien-urruty-sonarsource left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we add a couple of tests to verify that we support this lenient argument parsing?

@nquinquenel nquinquenel force-pushed the bug/nq/MCP-106-fix-type-parsing branch from 469cdcb to c470644 Compare September 10, 2025 10:03
@sonarqubecloud
Copy link

🤖 Pull Request summary

Refactors Tool.Arguments to use pattern matching and improve type safety.

• Replaces unsafe type casting with switch expressions using pattern matching for getStringOrThrow, getOptionalInteger, and getOptionalBoolean methods
• Adds type-safe handling for String/Integer conversion in getOptionalInteger method
• Updates getIntOrDefault to use getOptionalInteger instead of string parsing
• Adds comprehensive test coverage for all argument parsing methods (238 new test lines)

Review focus: Verify pattern matching logic handles all expected input types correctly, especially edge cases with null values and type conversions in the switch statements.

💬 Please send your feedback

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
100.0% Coverage on New Code
0.0% Duplication on New Code

See analysis details on SonarQube Cloud

@nquinquenel nquinquenel merged commit 4c5f897 into master Sep 10, 2025
4 checks passed
@nquinquenel nquinquenel deleted the bug/nq/MCP-106-fix-type-parsing branch September 10, 2025 10:12
stvnksslr pushed a commit to stvnksslr/sonarqube-mcp-server that referenced this pull request Oct 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants