Skip to content

Merge pull request #280 from Phoenix-Starlight/refactor/validate-even… #74

Merge pull request #280 from Phoenix-Starlight/refactor/validate-even…

Merge pull request #280 from Phoenix-Starlight/refactor/validate-even… #74

Triggered via push March 22, 2024 18:18
Status Success
Total duration 1m 44s
Artifacts

qodana.yml

on: push
Fit to window
Zoom out
Zoom in

Annotations

166 warnings
Busy wait: src/main/java/com/seailz/discordjar/voice/udp/VoiceUDP.java#L68
Call to `Thread.sleep()` in a loop, probably busy-waiting
Busy wait: src/main/java/com/seailz/discordjar/cache/JsonCache.java#L71
Call to `Thread.sleep()` in a loop, probably busy-waiting
Busy wait: src/main/java/com/seailz/discordjar/voice/udp/VoiceUDP.java#L101
Call to `Thread.sleep()` in a loop, probably busy-waiting
Busy wait: src/main/java/com/seailz/discordjar/model/channel/internal/AudioChannelImpl.java#L72
Call to `Thread.sleep()` in a loop, probably busy-waiting
Busy wait: src/main/java/com/seailz/discordjar/gateway/heartbeat/HeartLogic.java#L72
Call to `Thread.sleep()` in a loop, probably busy-waiting
Busy wait: src/main/java/com/seailz/discordjar/voice/ws/VoiceGatewayFactory.java#L111
Call to `Thread.sleep()` in a loop, probably busy-waiting
Busy wait: src/main/java/com/seailz/discordjar/gateway/heartbeat/HeartLogic.java#L83
Call to `Thread.sleep()` in a loop, probably busy-waiting
Busy wait: src/main/java/com/seailz/discordjar/utils/StatusRotor.java#L36
Call to `Thread.sleep()` in a loop, probably busy-waiting
Busy wait: src/main/java/com/seailz/discordjar/utils/memory/MemoryWatcher.java#L38
Call to `Thread.sleep()` in a loop, probably busy-waiting
Busy wait: src/main/java/com/seailz/discordjar/utils/rest/DiscordRequest.java#L186
Call to `Thread.sleep()` in a loop, probably busy-waiting
Busy wait: src/main/java/com/seailz/discordjar/DiscordJar.java#L273
Call to `Thread.sleep()` in a loop, probably busy-waiting
Busy wait: src/main/java/com/seailz/discordjar/DiscordJar.java#L343
Call to `Thread.sleep()` in a loop, probably busy-waiting
Constant values: src/main/java/com/seailz/discordjar/voice/udp/VoiceUDP.java#L112
Condition `packet != null` is always `true`
Constant values: src/main/java/com/seailz/discordjar/voice/udp/VoiceUDP.java#L81
Condition `frame != null` is always `true` when reached
Constant values: src/main/java/com/seailz/discordjar/model/mentions/AllowedMentions.java#L48
Condition `users == null` is always `false`
Constant values: src/main/java/com/seailz/discordjar/model/mentions/AllowedMentions.java#L40
Condition `parse == null` is always `false`
Constant values: src/main/java/com/seailz/discordjar/utils/rest/DiscordRequest.java#L246
Condition `contentType != null` is always `true`
Constant values: src/main/java/com/seailz/discordjar/model/channel/interfaces/Transcriptable.java#L268
Condition `new Color(embed.color()) != null` is always `true`
Constant values: src/main/java/com/seailz/discordjar/events/EventDispatcher.java#L109
Condition `listenersForEventType == null` is always `false`
Constant values: src/main/java/com/seailz/discordjar/cache/Cache.java#L85
Condition `cache.size() == -1` is always `false`
Constant values: src/main/java/com/seailz/discordjar/model/channel/interfaces/Transcriptable.java#L312
Result of `embed.author().url()` is always 'null'
Constant values: src/main/java/com/seailz/discordjar/voice/udp/VoiceUDP.java#L92
Condition `packet != null` is always `true`
Constant values: src/main/java/com/seailz/discordjar/cache/Cache.java#L57
Condition `t == null` is always `false`
Constant values: src/main/java/com/seailz/discordjar/model/mentions/AllowedMentions.java#L44
Condition `roles == null` is always `false`
Constant values: src/main/java/com/seailz/discordjar/utils/rest/DiscordRequest.java#L243
Condition `contentType == null` is always `false`
Contract issues: src/main/java/com/seailz/discordjar/model/monetization/SKU.java#L127
Method takes 2 parameters, while contract clause '_ -\> new' expects 1
Nullability and data flow problems: src/main/java/com/seailz/discordjar/action/sku/ListEntitlementRequest.java#L119
Method invocation `id` may produce `NullPointerException`
Nullability and data flow problems: src/main/java/com/seailz/discordjar/gateway/events/DispatchedEvents.java#L255
Dereference of `CommandType.fromCode(p.getJSONObject("d").getJSONObject("data").getInt("type"))` may produce `NullPointerException`
Nullability and data flow problems: src/main/java/com/seailz/discordjar/utils/rest/DiscordRequest.java#L273
Argument `responseHeaders.get("X-RateLimit-Reset-After")` might be null
Nullability and data flow problems: src/main/java/com/seailz/discordjar/DiscordJar.java#L1515
Method invocation `id` may produce `NullPointerException`
Nullability and data flow problems: src/main/java/com/seailz/discordjar/utils/rest/DiscordRequest.java#L270
Argument `responseHeaders.get("X-RateLimit-Limit")` might be null
Nullability and data flow problems: src/main/java/com/seailz/discordjar/model/invite/internal/InviteMetadataImpl.java#L79
Method invocation `getCode` may produce `NullPointerException`
Nullability and data flow problems: src/main/java/com/seailz/discordjar/model/invite/internal/InviteMetadataImpl.java#L76
Method invocation `compile` may produce `NullPointerException`
Nullability and data flow problems: src/main/java/com/seailz/discordjar/utils/rest/DiscordRequest.java#L272
Argument `responseHeaders.get("X-RateLimit-Reset")` might be null
Nullability and data flow problems: src/main/java/com/seailz/discordjar/DiscordJar.java#L1182
Method invocation `id` may produce `NullPointerException`
Nullability and data flow problems: src/main/java/com/seailz/discordjar/model/channel/MessagingChannel.java#L171
Dereference of `permissionOverwrites()` may produce `NullPointerException`
Nullability and data flow problems: src/main/java/com/seailz/discordjar/DiscordJar.java#L1260
Method invocation `id` may produce `NullPointerException`
Nullability and data flow problems: src/main/java/com/seailz/discordjar/model/guild/Guild.java#L1143
Method invocation `forEach` may produce `NullPointerException`
Nullability and data flow problems: src/main/java/com/seailz/discordjar/DiscordJar.java#L1338
Method invocation `id` may produce `NullPointerException`
Nullability and data flow problems: src/main/java/com/seailz/discordjar/model/channel/thread/Thread.java#L132
Dereference of `permissionOverwrites()` may produce `NullPointerException`
Nullability and data flow problems: src/main/java/com/seailz/discordjar/utils/rest/DiscordRequest.java#L271
Argument `responseHeaders.get("X-RateLimit-Remaining")` might be null
Nullability and data flow problems: src/main/java/com/seailz/discordjar/model/invite/internal/InviteMetadataImpl.java#L78
Method invocation `compile` may produce `NullPointerException`
Nullability and data flow problems: src/main/java/com/seailz/discordjar/DiscordJar.java#L1160
Method invocation `id` may produce `NullPointerException`
Nullability and data flow problems: src/main/java/com/seailz/discordjar/model/automod/AutomodRule.java#L125
Method invocation `roles` may produce `NullPointerException`
Nullability and data flow problems: src/main/java/com/seailz/discordjar/DiscordJar.java#L1213
Method invocation `id` may produce `NullPointerException`
Nullability and data flow problems: src/main/java/com/seailz/discordjar/events/model/automod/AutoModExecutionEvent.java#L49
Method invocation `asGuildChannel` may produce `NullPointerException`
Nullability and data flow problems: src/main/java/com/seailz/discordjar/model/guild/Guild.java#L1116
Method invocation `getJSONArray` may produce `NullPointerException`
Nullability and data flow problems: src/main/java/com/seailz/discordjar/model/guild/Member.java#L151
Method invocation `roles` may produce `NullPointerException`
Nullability and data flow problems: src/main/java/com/seailz/discordjar/model/channel/GuildChannel.java#L110
Method invocation `add` may produce `NullPointerException`
Nullability and data flow problems: src/main/java/com/seailz/discordjar/model/channel/internal/GuildChannelImpl.java#L36
Expression `this.guild` might evaluate to null but is returned by the method declared as @NotNull
Nullability and data flow problems: src/main/java/com/seailz/discordjar/DiscordJar.java#L1283
Method invocation `id` may produce `NullPointerException`
Nullability and data flow problems: src/main/java/com/seailz/discordjar/http/HttpOnlyManager.java#L80
Dereference of `CommandType.fromCode(new JSONObject(interaction.raw()).getJSONObject("data").getInt("type"))` may produce `NullPointerException`
Nullability and data flow problems: src/main/java/com/seailz/discordjar/DiscordJar.java#L381
Method invocation `bot` may produce `NullPointerException`
Nullability and data flow problems: src/main/java/com/seailz/discordjar/DiscordJar.java#L1410
Method invocation `id` may produce `NullPointerException`
Nullability and data flow problems: src/main/java/com/seailz/discordjar/model/channel/GuildChannel.java#L50
Dereference of `permissionOverwrites()` may produce `NullPointerException`
Nullability and data flow problems: src/main/java/com/seailz/discordjar/DiscordJar.java#L480
Argument `getSelfUserCache.get()` might be null
Nullability and data flow problems: src/main/java/com/seailz/discordjar/events/model/guild/member/GuildMemberUpdateEvent.java#L39
Method invocation `getMemberById` may produce `NullPointerException`
Nullability and data flow problems: src/main/java/com/seailz/discordjar/DiscordJar.java#L1387
Method invocation `id` may produce `NullPointerException`
Nullability and data flow problems: src/main/java/com/seailz/discordjar/model/invite/internal/InviteMetadataImpl.java#L81
Method invocation `compile` may produce `NullPointerException`
Nullability and data flow problems: src/main/java/com/seailz/discordjar/utils/rest/DiscordRequest.java#L256
Method invocation `string` may produce `NullPointerException`
Nullability and data flow problems: src/main/java/com/seailz/discordjar/model/invite/internal/InviteMetadataImpl.java#L80
Method invocation `compile` may produce `NullPointerException`
Nullability and data flow problems: src/main/java/com/seailz/discordjar/utils/rest/DiscordRequest.java#L120
Method invocation `string` may produce `NullPointerException`
Nullability and data flow problems: src/main/java/com/seailz/discordjar/DiscordJar.java#L1141
Method invocation `id` may produce `NullPointerException`
Nullability and data flow problems: src/main/java/com/seailz/discordjar/DiscordJar.java#L1364
Method invocation `id` may produce `NullPointerException`
Nullability and data flow problems: src/main/java/com/seailz/discordjar/DiscordJar.java#L1306
Method invocation `id` may produce `NullPointerException`
Nullability and data flow problems: src/main/java/com/seailz/discordjar/DiscordJar.java#L1238
Method invocation `id` may produce `NullPointerException`
Infinite loop statement: src/main/java/com/seailz/discordjar/utils/memory/MemoryWatcher.java#L25
`while` statement cannot complete without throwing an exception
Infinite recursion: src/main/java/com/seailz/discordjar/model/message/Message.java#L106
Method `decompile()` recurses infinitely, and can only end by throwing an exception
Inner class may be 'static': src/main/java/com/seailz/discordjar/ws/WebSocket.java#L297
Inner class `WebsocketExceptionError` may be 'static'
Inner class may be 'static': src/main/java/com/seailz/discordjar/ws/WebSocket.java#L309
Inner class `WebsocketDisconnectError` may be 'static'
Inner class may be 'static': src/main/java/com/seailz/discordjar/utils/rest/Response.java#L118
Inner class `ErroredResponse` may be 'static'
Instantiation of utility class: src/main/java/examples/Bot.java#L11
Instantiation of utility class `Bot`
Mismatched query and update of collection: src/main/java/com/seailz/discordjar/command/CommandDispatcher.java#L68
Contents of collection `subOptions` are updated, but never queried
Simplifiable conditional expression: src/main/java/com/seailz/discordjar/model/embed/Embed.java#L35
`url == null ? null : url` can be simplified to 'url'
Simplifiable conditional expression: src/main/java/com/seailz/discordjar/model/embed/Embed.java#L34
`description == null ? null : description` can be simplified to 'description'
Simplifiable conditional expression: src/main/java/com/seailz/discordjar/model/embed/Embed.java#L32
`title == null ? null : title` can be simplified to 'title'
Simplifiable conditional expression: src/main/java/com/seailz/discordjar/model/embed/Embed.java#L36
`timestamp == null ? null : timestamp` can be simplified to 'timestamp'
Suspicious 'Collection.toArray()' call: src/main/java/com/seailz/discordjar/model/guild/Guild.java#L560
Array of type 'java.lang.Object\[\]' expected, 'java.lang.String\[\]' found
Unused assignment: src/main/java/com/seailz/discordjar/DiscordJar.java#L1369
Variable `res` initializer `null` is redundant
Unused assignment: src/main/java/com/seailz/discordjar/DiscordJar.java#L609
Variable `raw` initializer `null` is redundant
Unused assignment: src/main/java/com/seailz/discordjar/utils/image/ImageUtils.java#L12
Variable `fileType` initializer `null` is redundant
Unused assignment: src/main/java/com/seailz/discordjar/DiscordJar.java#L651
Variable `raw` initializer `null` is redundant
Unused assignment: src/main/java/com/seailz/discordjar/model/component/select/entity/RoleSelectMenu.java#L126
The value `new ArrayList<>()` assigned to `this.defaultValues` is never used
Unused assignment: src/main/java/com/seailz/discordjar/model/user/User.java#L234
Variable `resp` initializer `null` is redundant
Unused assignment: src/main/java/com/seailz/discordjar/action/message/MessageEditAction.java#L68
The value `attachments` assigned to `this.attachments` is never used
Unused assignment: src/main/java/com/seailz/discordjar/DiscordJar.java#L567
Variable `raw` initializer `null` is redundant
Unused assignment: src/main/java/com/seailz/discordjar/DiscordJar.java#L691
Variable `raw` initializer `null` is redundant
Unused assignment: src/main/java/com/seailz/discordjar/DiscordJar.java#L546
Variable `raw` initializer `null` is redundant
Unused assignment: src/main/java/com/seailz/discordjar/model/application/Application.java#L321
Variable `response` initializer `null` is redundant
Unused assignment: src/main/java/com/seailz/discordjar/utils/rest/DiscordRequest.java#L351
The value `json.getString("message")` assigned to `message` is never used
Unused assignment: src/main/java/com/seailz/discordjar/model/guild/Guild.java#L1083
Variable `req` initializer `null` is redundant
Unused assignment: src/main/java/com/seailz/discordjar/action/channel/ModifyBaseChannelAction.java#L294
Variable `response` initializer `null` is redundant
Unused assignment: src/main/java/com/seailz/discordjar/DiscordJar.java#L1218
Variable `res` initializer `null` is redundant
Unused assignment: src/main/java/com/seailz/discordjar/model/guild/Guild.java#L970
Variable `arr` initializer `null` is redundant
Unused assignment: src/main/java/com/seailz/discordjar/action/message/MessageEditAction.java#L238
Variable `response` initializer `null` is redundant
Unused assignment: src/main/java/com/seailz/discordjar/model/guild/Member.java#L109
Variable `permissions` initializer `null` is redundant
Unused assignment: src/main/java/com/seailz/discordjar/action/message/MessageCreateAction.java#L359
Variable `response` initializer `null` is redundant
Unused assignment: src/main/java/com/seailz/discordjar/model/guild/Guild.java#L996
Variable `arr` initializer `null` is redundant
Unused assignment: src/main/java/com/seailz/discordjar/DiscordJar.java#L1187
Variable `res` initializer `null` is redundant
Unused assignment: src/main/java/com/seailz/discordjar/DiscordJar.java#L670
Variable `raw` initializer `null` is redundant
Unused assignment: src/main/java/com/seailz/discordjar/model/interaction/Interaction.java#L178
Variable `compileMethod` initializer `null` is redundant
Unused assignment: src/main/java/com/seailz/discordjar/model/status/activity/Activity.java#L153
The value `null` assigned to `state` is never used
Unused assignment: src/main/java/com/seailz/discordjar/model/guild/Guild.java#L1132
Variable `response` initializer `null` is redundant
Unused assignment: src/main/java/com/seailz/discordjar/model/guild/Guild.java#L644
The value `obj.getInt("approximate_member_count")` assigned to `approximateMemberCount` is never used
Unused assignment: src/main/java/com/seailz/discordjar/DiscordJar.java#L1343
Variable `res` initializer `null` is redundant
Unused assignment: src/main/java/com/seailz/discordjar/model/role/RoleTag.java#L30
Variable `availableForPurchase` initializer `false` is redundant
Unused assignment: src/main/java/com/seailz/discordjar/model/message/Message.java#L590
Variable `res` initializer `null` is redundant
Unused assignment: src/main/java/com/seailz/discordjar/action/message/StartThreadForumChannelAction.java#L193
The value `attachments` assigned to `this.attachments` is never used
Unused assignment: src/main/java/com/seailz/discordjar/DiscordJar.java#L1520
Variable `res` initializer `null` is redundant
Unused assignment: src/main/java/com/seailz/discordjar/DiscordJar.java#L974
Variable `req` initializer `null` is redundant
Unused assignment: src/main/java/com/seailz/discordjar/DiscordJar.java#L630
Variable `raw` initializer `null` is redundant
Unused assignment: src/main/java/com/seailz/discordjar/model/permission/PermissionOverwrite.java#L75
Variable `allowList` initializer `null` is redundant
Unused assignment: src/main/java/com/seailz/discordjar/DiscordJar.java#L816
Variable `response` initializer `null` is redundant
Unused assignment: src/main/java/com/seailz/discordjar/cache/Cache.java#L246
Variable `response` initializer `null` is redundant
Unused assignment: src/main/java/com/seailz/discordjar/action/sku/ListEntitlementRequest.java#L114
Variable `req` initializer `null` is redundant
Unused assignment: src/main/java/com/seailz/discordjar/voice/udp/VoiceUDP.java#L79
Variable `packet` initializer `null` is redundant
Unused assignment: src/main/java/com/seailz/discordjar/action/message/MessageCreateAction.java#L74
The value `attachments` assigned to `this.attachments` is never used
Unused assignment: src/main/java/com/seailz/discordjar/model/component/Component.java#L66
Variable `method` initializer `null` is redundant
Unused assignment: src/main/java/com/seailz/discordjar/DiscordJar.java#L487
Variable `response` initializer `null` is redundant
Unused assignment: src/main/java/com/seailz/discordjar/model/status/activity/Activity.java#L152
The value `obj.getString("state")` assigned to `state` is never used
Unused assignment: src/main/java/com/seailz/discordjar/model/component/select/entity/ChannelSelectMenu.java#L146
The value `new ArrayList<>()` assigned to `this.defaultValues` is never used
Unused assignment: src/main/java/com/seailz/discordjar/DiscordJar.java#L1456
Variable `response` initializer `null` is redundant
Unused assignment: src/main/java/com/seailz/discordjar/model/guild/Guild.java#L646
The value `0` assigned to `approximateMemberCount` is never used
Unused assignment: src/main/java/com/seailz/discordjar/DiscordJar.java#L588
Variable `raw` initializer `null` is redundant
Unused assignment: src/main/java/com/seailz/discordjar/model/component/select/entity/UserSelectMenu.java#L101
The value `new ArrayList<>()` assigned to `this.defaultValues` is never used
Unused assignment: src/main/java/com/seailz/discordjar/model/role/RoleTag.java#L31
Variable `guildConnections` initializer `false` is redundant
Unused assignment: src/main/java/com/seailz/discordjar/action/guild/GetCurrentUserGuildsAction.java#L100
Variable `response` initializer `null` is redundant
Unused assignment: src/main/java/com/seailz/discordjar/model/component/select/entity/MentionableSelectMenu.java#L117
The value `new HashMap<>()` assigned to `this.defaultValues` is never used
Unused assignment: src/main/java/com/seailz/discordjar/DiscordJar.java#L1482
Variable `res` initializer `null` is redundant
Unused assignment: src/main/java/com/seailz/discordjar/DiscordJar.java#L1311
Variable `res` initializer `null` is redundant
Unused assignment: src/main/java/com/seailz/discordjar/voice/ws/VoiceGatewayFactory.java#L72
Variable `udp` initializer `null` is redundant
Unused assignment: src/main/java/com/seailz/discordjar/utils/rest/ratelimit/Bucket.java#L23
Variable `debug` initializer `false` is redundant
Unused assignment: src/main/java/com/seailz/discordjar/DiscordJar.java#L1243
Variable `res` initializer `null` is redundant
Unused assignment: src/main/java/com/seailz/discordjar/model/permission/PermissionOverwrite.java#L76
Variable `denyList` initializer `null` is redundant
qodana
Node.js 16 actions are deprecated. Please update the following actions to use Node.js 20: actions/checkout@v3, JetBrains/[email protected]. For more information see: https://github.blog/changelog/2023-09-22-github-actions-transitioning-from-node-16-to-node-20/.