Skip to content
This repository was archived by the owner on Oct 9, 2025. It is now read-only.

Conversation

@dev-737
Copy link
Member

@dev-737 dev-737 commented Jul 26, 2024

WIP

* 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
@deepsource-io
Copy link

deepsource-io bot commented Jul 26, 2024

Here's the code health analysis summary for commits 4ba4c6c..9d29cb7. View details on DeepSource ↗.

Analysis Summary

AnalyzerStatusSummaryLink
DeepSource JavaScript LogoJavaScript✅ Success
🎯 7 occurences resolved
View Check ↗

💡 If you’re a repository administrator, you can configure the quality gates from the settings.

@@ -1,7 +1,24 @@
import { RegisterInteractionHandler } from '#main/decorators/Interaction.js';

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(

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(

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(

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(

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.

@dev-737 dev-737 force-pushed the v4 branch 2 times, most recently from 03b66b2 to af899ec Compare July 27, 2024 11:22
@@ -1,7 +1,23 @@
import { RegisterInteractionHandler } from '#main/decorators/Interaction.js';

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.

@dev-737 dev-737 linked an issue Aug 10, 2024 that may be closed by this pull request
await storeMessageData(message, sendResult, connection.hubId, dbReferrence);
}

private async sendBroadcast(

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()

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()

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()

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;

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.
Copy link

@qlty-cloud-legacy qlty-cloud-legacy bot left a 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.

Copy link

@qlty-cloud-legacy qlty-cloud-legacy bot left a 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.

Copy link

@qlty-cloud-legacy qlty-cloud-legacy bot left a 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.

Copy link

@qlty-cloud-legacy qlty-cloud-legacy bot left a 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.

Copy link

@qlty-cloud-legacy qlty-cloud-legacy bot left a 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.

@qlty-cloud-legacy
Copy link

Code Climate has analyzed commit f37ccb8 and detected 102 issues on this pull request.

Here's the issue category breakdown:

Category Count
Complexity 39
Duplication 63

View more on Code Climate.

@dev-737 dev-737 changed the title Version 4 refactor: clean up codebase to make it at least a little readable Aug 20, 2024
@dev-737 dev-737 merged commit b61338e into main Aug 20, 2024
@dev-737 dev-737 removed a link to an issue Aug 20, 2024
@dev-737 dev-737 deleted the v4 branch August 20, 2024 15:56
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants