Repository Analysis

discordjs/discord.js

A powerful JavaScript library for interacting with the Discord API

1.8 Likely human-written View on GitHub
1.8
Adjusted Score
1.8
Raw Score
100%
Time Factor
2026-05-26
Last Push
26,717
Stars
TypeScript
Language
195,585
Lines of Code
1506
Files
112
Pattern Hits
2026-05-31
Scan Date

Score History

Severity Breakdown

CRITICAL 12HIGH 31MEDIUM 2LOW 67

Pattern Findings

112 matches across 6 categories. Click a row to expand file-level details.

Cross-File Repetition31 hits · 155 pts
SeverityFileLineSnippet
HIGHpackages/discord.js/cliff.toml0# changelog all notable changes to this project will be documented in this file.\n
HIGHpackages/ui/cliff.toml0# changelog all notable changes to this project will be documented in this file.\n
HIGHpackages/brokers/cliff.toml0# changelog all notable changes to this project will be documented in this file.\n
HIGHpackages/next/cliff.toml0# changelog all notable changes to this project will be documented in this file.\n
HIGHpackages/collection/cliff.toml0# changelog all notable changes to this project will be documented in this file.\n
HIGHpackages/core/cliff.toml0# changelog all notable changes to this project will be documented in this file.\n
HIGHpackages/proxy/cliff.toml0# changelog all notable changes to this project will be documented in this file.\n
HIGHpackages/structures/cliff.toml0# changelog all notable changes to this project will be documented in this file.\n
HIGHpackages/create-discord-bot/cliff.toml0# changelog all notable changes to this project will be documented in this file.\n
HIGHpackages/util/cliff.toml0# changelog all notable changes to this project will be documented in this file.\n
HIGHpackages/builders/cliff.toml0# changelog all notable changes to this project will be documented in this file.\n
HIGHpackages/formatters/cliff.toml0# changelog all notable changes to this project will be documented in this file.\n
HIGHpackages/voice/cliff.toml0# changelog all notable changes to this project will be documented in this file.\n
HIGH…/scripts/turbo/generators/templates/default/cliff.toml0# changelog all notable changes to this project will be documented in this file.\n
HIGHpackages/rest/cliff.toml0# changelog all notable changes to this project will be documented in this file.\n
HIGHpackages/ws/cliff.toml0# changelog all notable changes to this project will be documented in this file.\n
HIGHpackages/discord.js/cliff.toml0{%- macro remote_url() -%} https://github.com/{{ remote.github.owner }}/{{ remote.github.repo }} {%- endmacro -%} {% if
HIGHpackages/brokers/cliff.toml0{%- macro remote_url() -%} https://github.com/{{ remote.github.owner }}/{{ remote.github.repo }} {%- endmacro -%} {% if
HIGHpackages/next/cliff.toml0{%- macro remote_url() -%} https://github.com/{{ remote.github.owner }}/{{ remote.github.repo }} {%- endmacro -%} {% if
HIGHpackages/collection/cliff.toml0{%- macro remote_url() -%} https://github.com/{{ remote.github.owner }}/{{ remote.github.repo }} {%- endmacro -%} {% if
HIGHpackages/core/cliff.toml0{%- macro remote_url() -%} https://github.com/{{ remote.github.owner }}/{{ remote.github.repo }} {%- endmacro -%} {% if
HIGHpackages/proxy/cliff.toml0{%- macro remote_url() -%} https://github.com/{{ remote.github.owner }}/{{ remote.github.repo }} {%- endmacro -%} {% if
HIGHpackages/structures/cliff.toml0{%- macro remote_url() -%} https://github.com/{{ remote.github.owner }}/{{ remote.github.repo }} {%- endmacro -%} {% if
HIGHpackages/create-discord-bot/cliff.toml0{%- macro remote_url() -%} https://github.com/{{ remote.github.owner }}/{{ remote.github.repo }} {%- endmacro -%} {% if
HIGHpackages/util/cliff.toml0{%- macro remote_url() -%} https://github.com/{{ remote.github.owner }}/{{ remote.github.repo }} {%- endmacro -%} {% if
HIGHpackages/builders/cliff.toml0{%- macro remote_url() -%} https://github.com/{{ remote.github.owner }}/{{ remote.github.repo }} {%- endmacro -%} {% if
HIGHpackages/formatters/cliff.toml0{%- macro remote_url() -%} https://github.com/{{ remote.github.owner }}/{{ remote.github.repo }} {%- endmacro -%} {% if
HIGHpackages/voice/cliff.toml0{%- macro remote_url() -%} https://github.com/{{ remote.github.owner }}/{{ remote.github.repo }} {%- endmacro -%} {% if
HIGH…/scripts/turbo/generators/templates/default/cliff.toml0{%- macro remote_url() -%} https://github.com/{{ remote.github.owner }}/{{ remote.github.repo }} {%- endmacro -%} {% if
HIGHpackages/rest/cliff.toml0{%- macro remote_url() -%} https://github.com/{{ remote.github.owner }}/{{ remote.github.repo }} {%- endmacro -%} {% if
HIGHpackages/ws/cliff.toml0{%- macro remote_url() -%} https://github.com/{{ remote.github.owner }}/{{ remote.github.repo }} {%- endmacro -%} {% if
Hallucination Indicators12 hits · 120 pts
SeverityFileLineSnippet
CRITICALpackages/discord.js/src/structures/Presence.js396 return this.activity.presence.client.rest.cdn.appAsset(this.activity.applicationId, this.smallImage, options);
CRITICALpackages/discord.js/src/structures/Presence.js423 return this.activity.presence.client.rest.cdn.appAsset(this.activity.applicationId, this.largeImage, options);
CRITICALpackages/discord.js/src/structures/ThreadMember.js80 return this.member ?? this.thread.guild.members.cache.get(this.id) ?? null;
CRITICAL…s/discord.js/src/structures/AutocompleteInteraction.js74 return this.guild?.commands.cache.get(id) ?? this.client.application.commands.cache.get(id) ?? null;
CRITICAL…ckages/discord.js/src/structures/CommandInteraction.js90 return this.guild?.commands.cache.get(id) ?? this.client.application.commands.cache.get(id) ?? null;
CRITICALpackages/discord.js/src/structures/GuildMember.js376 return this.guild.members.me.roles.highest.comparePositionTo(this.roles.highest) > 0;
CRITICALpackages/discord.js/src/structures/GuildMember.js387 return this.manageable && this.guild.members.me.permissions.has(PermissionFlagsBits.KickMembers);
CRITICALpackages/discord.js/src/structures/GuildMember.js398 return this.manageable && this.guild.members.me.permissions.has(PermissionFlagsBits.BanMembers);
CRITICAL…ord.js/src/structures/AutoModerationActionExecution.js117 return this.guild.client.users.cache.get(this.userId) ?? null;
CRITICALpackages/discord.js/src/structures/GuildEmoji.js64 return !this.managed && this.guild.members.me.permissions.has(PermissionFlagsBits.ManageGuildExpressions);
CRITICALpackages/discord.js/src/util/Sweepers.js130 const entitlements = this.client.application.entitlements.cache.sweep(filter);
CRITICALpackages/voice/src/VoiceConnection.ts757 return this.state.networking.state.dave.getVerificationCode(userId);
Hyper-Verbose Identifiers38 hits · 38 pts
SeverityFileLineSnippet
LOWpackages/discord.js/typings/index.d.ts3812export function fetchRecommendedShardCount(token: string, options?: FetchRecommendedShardCountOptions): Promise<number>;
LOWpackages/discord.js/typings/index.d.ts4210export abstract class DataManager<Key, Holds, Resolvable> extends BaseManager {
LOWpackages/discord.js/src/util/Util.js81async function fetchRecommendedShardCount(
LOWpackages/discord.js/src/util/Components.js299function extractInteractiveComponents(component) {
LOWpackages/discord.js/src/util/Channels.js107function transformAPIGuildForumTag(tag) {
LOWpackages/discord.js/src/util/Channels.js147function transformAPIGuildDefaultReaction(defaultReaction) {
LOWpackages/discord.js/src/util/Channels.js162function transformGuildDefaultReaction(defaultReaction) {
LOWpackages/discord.js/src/managers/DataManager.js12class DataManager extends BaseManager {
LOW…s/ui/src/lib/components/discord/MessageEmbedAuthor.tsx7export function DiscordMessageEmbedAuthor({ avatar, url, username }: IDiscordMessageEmbedAuthor) {
LOW…s/ui/src/lib/components/discord/MessageInteraction.tsx11export function DiscordMessageInteraction({ author, authorNode, command }: IDiscordMessageInteraction) {
LOW…s/ui/src/lib/components/discord/MessageAuthorReply.tsx11export function DiscordMessageAuthorReply({ avatar, bot, verified, color, username }: IDiscordMessageAuthorReply) {
LOW…s/ui/src/lib/components/discord/MessageEmbedFooter.tsx7export function DiscordMessageEmbedFooter({ content, icon, timestamp }: IDiscordMessageEmbedFooter) {
LOW…i/src/lib/components/discord/MessageEmbedThumbnail.tsx6export function DiscordMessageEmbedThumbnail({ alt, image }: IDiscordMessageEmbedThumbnail) {
LOW…s/ui/src/lib/components/discord/MessageEmbedFields.tsx7export function DiscordMessageEmbedFields({ fields }: IDiscordMessageEmbedFields) {
LOWpackages/collection/__tests__/collection.test.ts20function expectInvalidFunctionError(cb: () => unknown, val?: unknown): void {
LOWpackages/proxy/src/util/responseHelpers.ts12export async function populateSuccessfulResponse(res: ServerResponse, data: ResponseLike): Promise<void> {
LOWpackages/proxy/src/util/responseHelpers.ts35export function populateGeneralErrorResponse(res: ServerResponse, error: DiscordAPIError | HTTPError): void {
LOWpackages/proxy/src/util/responseHelpers.ts50export function populateRatelimitErrorResponse(res: ServerResponse, error: RateLimitError): void {
LOWpackages/proxy/src/util/responseHelpers.ts60export function populateAbortErrorResponse(res: ServerResponse): void {
LOWpackages/structures/src/utils/optimization.ts19export function dateToDiscordISOTimestamp(date: Date) {
LOWpackages/util/src/functions/runtime.ts3export function shouldUseGlobalFetchAndWebSocket() {
LOW…kages/builders/__tests__/components/selectMenu.test.ts37function makeStringSelectMenuWithOptions() {
LOW…kages/builders/__tests__/components/selectMenu.test.ts47function mapStringSelectMenuOptionBuildersToJson(selectMenu: StringSelectMenuBuilder) {
LOWpackages/builders/src/components/Components.ts266export function resolveAccessoryComponent(component: APISectionAccessoryComponent) {
LOWpackages/voice/__tests__/VoiceConnection.test.ts74function createFakeVoiceConnection() {
LOWpackages/voice/__tests__/AudioPlayer.test.ts45function createVoiceConnectionMock() {
LOWpackages/voice/__tests__/entersState.test.ts7function createFakeVoiceConnection(status = VoiceConnectionStatus.Signalling) {
LOWpackages/voice/src/DataStore.ts19export function createJoinVoiceChannelPayload(config: JoinConfig) {
LOWpackages/voice/src/DataStore.ts36function getOrCreateGroup(group: string) {
LOWpackages/voice/src/receive/AudioReceiveStream.ts39export function createDefaultAudioReceiveStreamOptions(): AudioReceiveStreamOptions {
LOWpackages/voice/src/audio/TransformerGraph.ts118function canEnableFFmpegOptimizations(): boolean {
LOWpackages/scripts/src/generateSplitDocumentation.ts130function resolveCanonicalReference(
LOWpackages/scripts/src/generateSplitDocumentation.ts988async function writeSplitDocsToFileSystem({
LOWpackages/scripts/src/generateSplitDocumentation.ts1021export async function generateSplitDocumentation({
LOWpackages/rest/src/lib/utils/utils.ts129export function calculateUserDefaultAvatarIndex(userId: Snowflake) {
LOW…/ws/src/strategies/context/IContextFetchingStrategy.ts39export async function managerToFetchingStrategyOptions(manager: WebSocketManager): Promise<FetchingStrategyOptions> {
LOWpackages/ws/src/utils/constants.ts81export function getInitialSendRateLimitState(): SendRateLimitState {
LOWapps/website/src/hooks/useUnregisterServiceWorker.ts5export function useUnregisterServiceWorker() {
Over-Commented Block25 hits · 25 pts
SeverityFileLineSnippet
LOWpackages/next/api-extractor.json1{
LOWpackages/next/api-extractor.json21 // "@discordjs/core",
LOWpackages/scripts/src/generateSplitDocumentation.ts321 if (codeDestination) {
LOWpackages/scripts/src/generateSplitDocumentation.ts801 // return (
LOW…ages/api-extractor/src/enhancers/ValidationEnhancer.ts81 if (symbolMetadata.maxEffectiveReleaseTag === ReleaseTag.Internal) {
LOWpackages/api-extractor/src/collector/Collector.ts581 // Example 1:
LOWpackages/api-extractor/src/collector/Collector.ts941 let nodeForComment: ts.Node = declaration;
LOWpackages/api-extractor/src/collector/Collector.ts981
LOW…/api-extractor/src/schemas/api-extractor-template.json441 // "addToApiReportFile": false
LOW…ges/api-extractor/src/generators/DtsRollupGenerator.ts301 } else {
LOW…ges/api-extractor/src/generators/ApiReportGenerator.ts181 SourceFileLocationFormatter.formatDeclaration(astEntity.declaration),
LOW…ges/api-extractor/src/generators/ApiReportGenerator.ts501
LOW…ges/api-extractor/src/generators/ApiReportGenerator.ts521 // SyntaxList:
LOWpackages/api-extractor/src/analyzer/ExportAnalyzer.ts521 // ExportDeclaration:
LOWpackages/api-extractor/src/analyzer/ExportAnalyzer.ts541 // ExportKeyword: pre=[export] sep=[ ]
LOWpackages/api-extractor/src/analyzer/ExportAnalyzer.ts561 SourceFileLocationFormatter.formatDeclaration(declaration),
LOWpackages/api-extractor/src/analyzer/ExportAnalyzer.ts581 // }
LOWpackages/api-extractor/src/analyzer/ExportAnalyzer.ts641 // ImportKeyword: pre=[import] sep=[ ]
LOWpackages/api-extractor/src/analyzer/ExportAnalyzer.ts661 modulePath: externalModulePath,
LOWpackages/api-extractor/src/analyzer/ExportAnalyzer.ts701 // EXAMPLE:
LOWpackages/api-extractor/src/analyzer/ExportAnalyzer.ts741
LOWpackages/api-extractor/src/analyzer/AstSymbolTable.ts241 // namespace X {
LOWpackages/api-extractor/src/analyzer/AstSymbolTable.ts261 }
LOW…pi-extractor-model/src/mixins/ApiItemContainerMixin.ts481 // We want to find the reference token associated with the actual inherited declaration.
LOW…pi-extractor-model/src/mixins/ApiItemContainerMixin.ts561 // For example, in the code block below, `Bar.x` is reported as the inherited item, not `Foo.x`.
AI Slop Vocabulary2 hits · 6 pts
SeverityFileLineSnippet
MEDIUMpackages/structures/__tests__/types/Mixin.test-d.ts24// Since MixinProperty2 doesn't utilize the type of property1 in kData, this works and is ok
MEDIUMpackages/structures/__tests__/types/Mixin.test-d.ts29// Since MixinProperty2 doesn't utilize the type of property1 in kData, this works and is ok
Fake / Example Data4 hits · 6 pts
SeverityFileLineSnippet
LOWpackages/util/__tests__/lazy.test.ts14 const callback = vi.fn(() => 'Lorem Ipsum');
LOWpackages/util/__tests__/lazy.test.ts18 expect(lazyStoredValue()).toEqual('Lorem Ipsum');
LOWpackages/util/__tests__/lazy.test.ts22 const callback = vi.fn(() => 'Lorem Ipsum');
LOWpackages/util/__tests__/lazy.test.ts30 expect(cachedValue).toEqual('Lorem Ipsum');