fix: refactor handleRegularCharacter to eliminate invariant return - #25
Merged
Conversation
|
✅ Tests completed on Node.js 20.x: success |
Resolves SonarQube code smell S3516 by removing redundant if-else branches that both returned the same value. The function now advances the position unconditionally and only conditionally updates line/column tracking for newlines before returning the character once at the end. This maintains identical behavior while improving code maintainability.
|
✅ Tests completed on Node.js 20.x: success |
Refactors lineColMatch array access to use optional chaining (?.[]) instead of logical AND (&&) operators, making the code more concise and easier to read. This addresses SonarQube code quality suggestions while maintaining identical functionality. Changes: - Line 233: lineColMatch ? lineColMatch[1] → lineColMatch?.[1] - Line 234: lineColMatch && lineColMatch[2] → lineColMatch?.[2]
ggulpari
previously approved these changes
Nov 16, 2025
Slashmsu
force-pushed
the
claude/fix-issue-01QypNZfYqiqBj5n9zsh4yne
branch
from
November 16, 2025 15:09
aed4ac8 to
d33d617
Compare
|
✅ Tests completed on Node.js 20.x: success |
Remove duplicate coverage badges as CodeCov badge already provides test coverage information. This eliminates redundancy and keeps the badge section cleaner. Files updated: - README.md (English) - README.ru.md (Russian) - README.tj.md (Tajik)
|
|
✅ Tests completed on Node.js 20.x: success |
ggulpari
self-requested a review
November 16, 2025 15:23
ggulpari
approved these changes
Nov 16, 2025
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.



Resolves SonarQube code smell S3516 by removing redundant if-else branches that both returned the same value. The function now advances the position unconditionally and only conditionally updates line/column tracking for newlines before returning the character once at the end.
This maintains identical behavior while improving code maintainability.
🎉 Pull Request
Description
Type of Change
to not work as expected)
Related Issue
Fixes #(issue number)
Changes Made
Testing
npm test)npm run lint)npm run type-check)Checklist
Additional Context
📋 License Information
SomonScript is open source software licensed under the MIT License.
By submitting this pull request, you agree that your contributions will be
licensed under the MIT License.
For contribution guidelines, please review:
guidelines
Thank you for contributing to SomonScript! 🚀