Fix SonarCloud high-priority code quality issues#114
Open
Vipin-Sharma wants to merge 1 commit intomasterfrom
Open
Fix SonarCloud high-priority code quality issues#114Vipin-Sharma wants to merge 1 commit intomasterfrom
Vipin-Sharma wants to merge 1 commit intomasterfrom
Conversation
…eptions Fixed high-priority SonarCloud issues: 1. SQLServerDataTypeEnum - String literal duplication fix: - Created inner JdbcType class with constants for repeated JDBC type strings - Eliminates duplication of "String" (8x), "Byte[]" (3x), "Timestamp" (4x), "BigDecimal" (4x) - Maintains backward compatibility - all tests pass 2. Generator test cleanup - Removed unused exception declarations: - SelectMicroserviceGeneratorTest: Removed 2 unnecessary 'throws Exception' - UpdateMicroserviceGeneratorTest: Removed 1 unnecessary 'throws Exception' - These methods don't throw checked exceptions, declarations were misleading All 981 tests passing successfully. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
|
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.



Summary
Fixed multiple high-priority SonarCloud code quality issues focusing on string literal duplication and unnecessary exception declarations.
Changes Made
1. SQLServerDataTypeEnum - String Literal Duplication Fix (Critical Priority)
Problem: String literals were duplicated multiple times across enum values:
Solution: Created inner
JdbcTypeutility class with constants:Now enum values reference these constants instead of duplicating strings:
Benefits:
2. Generator Tests - Removed Unnecessary Exception Declarations (Minor Priority)
Cleaned up test methods that declared
throws Exceptionbut never actually throw checked exceptions:SelectMicroserviceGeneratorTest:
testGenerateSelectMicroservice_SqlException_PropagatesException()testGenerateSelectMicroservice_MetadataExtractionFailure_PropagatesException()UpdateMicroserviceGeneratorTest:
testGenerateUpdateMicroservice_DatabaseConnectionFailure_PropagatesException()These methods only throw
SQLExceptionorRuntimeException(unchecked), so thethrows Exceptiondeclaration was misleading and unnecessary.Test Results
✅ All 981 tests passing
✅ No functional changes - pure code quality improvements
✅ Full backward compatibility maintained
Impact on SonarCloud
This PR resolves:
🤖 Generated with Claude Code