Repository navigation
Fix the findings Sonar reports now that it resolves types - #1399
Merged
Merged
Conversation
With dependencies installed the scan sees the discord.js types, which surfaced deprecated API use and unsafe stringification: - modals use LabelBuilder/addLabelComponents instead of the deprecated ActionRow + TextInputBuilder.setLabel pattern (46 inputs) - Role colour via colors.primaryColor, StringSelect* names, GuildExpressions - missingPermission returns a readable permission name (permissionName), and member/channel mentions are cast or formatted so no template prints [object Object] - d.setup awaited the tripsit channel fetch (it printed [object Promise]) - await the premium role add so the token refund can actually trigger - RegExp.exec, a pointless await, and a redundant cast Co-Authored-By: Claude Sonnet 5.5 <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
After #1398 the SonarScan job installs dependencies, so Sonar now sees the discord.js types. That surfaced 110 findings it couldn't evaluate before.
LabelBuilder/addLabelComponentsinstead of the deprecated ActionRow +TextInputBuilder.setLabelpattern (46 inputs, 16 files); role colour usescolors.primaryColor;StringSelect*names;GuildExpressions.missingPermissionnow returns a readable permission name (permissionName), member/channel mentions are cast so they print correctly, audit-log values are serialized.d.setup.tsdidn't await a channel fetch (it printed[object Promise]);d.rpg.tsdidn't await the premium role add, so the token refund in itscatchcould never run.RegExp.exec, a pointlessawait, one redundant cast.Things to review
/feedback, a mod action modal,/setup).[object Object].missingPermissionnow returnsstring | nullinstead ofPermissionResolvable | null.Verification
tsc(app and vitest configs), ESLint on changed files: clean.npx vitest run --coverage: 2,265 passed, coverage 100%.🤖 Generated with Claude Code