-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor: clean up codebase to make it at least a little readable #87
Conversation
* feat(locale): use redis to fetch locale when needed get locale from redis or mongo when needed, instead of always setting <User>.locale. Avoids bugs * refactor(util): minor userLocale refactor
Here's the code health analysis summary for commits Analysis Summary
|
@@ -1,7 +1,24 @@ | |||
import { RegisterInteractionHandler } from '#main/decorators/Interaction.js'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
File customize.ts
has 274 lines of code (exceeds 250 allowed). Consider refactoring.
], | ||
ephemeral: true, | ||
}); | ||
await this.replyEmbed( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Similar blocks of code found in 2 locations. Consider refactoring.
], | ||
ephemeral: true, | ||
}); | ||
await this.replyEmbed( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Similar blocks of code found in 2 locations. Consider refactoring.
), | ||
), | ||
], | ||
await this.replyEmbed( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Similar blocks of code found in 2 locations. Consider refactoring.
], | ||
ephemeral: true, | ||
}); | ||
await this.replyEmbed( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Similar blocks of code found in 2 locations. Consider refactoring.
03b66b2
to
af899ec
Compare
@@ -1,7 +1,23 @@ | |||
import { RegisterInteractionHandler } from '#main/decorators/Interaction.js'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
File customize.ts
has 277 lines of code (exceeds 250 allowed). Consider refactoring.
src/events/messageCreate.ts
Outdated
await storeMessageData(message, sendResult, connection.hubId, dbReferrence); | ||
} | ||
|
||
private async sendBroadcast( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Function sendBroadcast
has 72 lines of code (exceeds 25 allowed). Consider refactoring.
.setURL(`${LINKS.DOCS}/legal/terms`) | ||
.setEmoji(emojis.docs_icon) | ||
.setStyle(ButtonStyle.Link), | ||
new ButtonBuilder() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Similar blocks of code found in 3 locations. Consider refactoring.
.setURL(`${LINKS.DOCS}/setup`) | ||
.setEmoji(emojis.guide_icon) | ||
.setStyle(ButtonStyle.Link), | ||
new ButtonBuilder() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Similar blocks of code found in 3 locations. Consider refactoring.
.setFooter({ text: `Sent for: ${guild.name}`, iconURL: guild.iconURL() ?? undefined }); | ||
|
||
const buttons = new ActionRowBuilder<ButtonBuilder>().addComponents( | ||
new ButtonBuilder() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Similar blocks of code found in 3 locations. Consider refactoring.
const emojiAlreadyReacted = dbReactions[reactedEmoji] ?? [user.id]; | ||
|
||
// max 10 reactions | ||
if (Object.keys(dbReactions).length >= 10) return; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Avoid too many return
statements within this function.
The cache is used/called in the code instead of being used in a middleware on all queries.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The PR diff size of 5553 lines exceeds the maximum allowed for the inline comments feature.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The PR diff size of 5992 lines exceeds the maximum allowed for the inline comments feature.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The PR diff size of 6129 lines exceeds the maximum allowed for the inline comments feature.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The PR diff size of 6129 lines exceeds the maximum allowed for the inline comments feature.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The PR diff size of 6394 lines exceeds the maximum allowed for the inline comments feature.
Code Climate has analyzed commit f37ccb8 and detected 102 issues on this pull request. Here's the issue category breakdown:
View more on Code Climate. |
WIP