Skip to content

fix(cache): in the event of a negative cache, reset it #1155

fix(cache): in the event of a negative cache, reset it

fix(cache): in the event of a negative cache, reset it #1155

Triggered via push November 11, 2024 16:35
Status Success
Total duration 3m 11s
Artifacts

codeql.yml

on: push
Matrix: Analyze
Fit to window
Zoom out
Zoom in

Annotations

170 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/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/cache/JsonCache.java#L71
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/DiscordJar.java#L274
Call to `Thread.sleep()` in a loop, probably busy-waiting
Busy wait: src/main/java/com/seailz/discordjar/DiscordJar.java#L344
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
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/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/utils/rest/ratelimit/Bucket.java#L84
Condition `affectedRoutes == null` is always `false`
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/model/mentions/AllowedMentions.java#L44
Condition `roles == 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/utils/rest/DiscordRequest.java#L243
Condition `contentType != 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/channel/interfaces/Transcriptable.java#L313
Result of `embed.author().url()` is always 'null'
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/utils/rest/DiscordRequest.java#L253
Method invocation `string` may produce `NullPointerException`
Nullability and data flow problems: src/main/java/com/seailz/discordjar/gateway/events/DispatchedEvents.java#L257
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#L269
Argument `responseHeaders.get("X-RateLimit-Reset")` 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/model/channel/MessagingChannel.java#L177
Dereference of `permissionOverwrites()` may produce `NullPointerException`
Nullability and data flow problems: src/main/java/com/seailz/discordjar/DiscordJar.java#L1416
Method invocation `id` may produce `NullPointerException`
Nullability and data flow problems: src/main/java/com/seailz/discordjar/DiscordJar.java#L382
Method invocation `bot` may produce `NullPointerException`
Nullability and data flow problems: src/main/java/com/seailz/discordjar/DiscordJar.java#L1188
Method invocation `id` may produce `NullPointerException`
Nullability and data flow problems: src/main/java/com/seailz/discordjar/DiscordJar.java#L1147
Method invocation `id` may produce `NullPointerException`
Nullability and data flow problems: src/main/java/com/seailz/discordjar/DiscordJar.java#L1370
Method invocation `id` may produce `NullPointerException`
Nullability and data flow problems: src/main/java/com/seailz/discordjar/DiscordJar.java#L483
Argument `getSelfUserCache.get()` might be null
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/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#L1312
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/events/model/automod/AutoModExecutionEvent.java#L49
Method invocation `asGuildChannel` may produce `NullPointerException`
Nullability and data flow problems: src/main/java/com/seailz/discordjar/DiscordJar.java#L1344
Method invocation `id` 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/utils/rest/DiscordRequest.java#L270
Argument `responseHeaders.get("X-RateLimit-Reset-After")` might be null
Nullability and data flow problems: src/main/java/com/seailz/discordjar/DiscordJar.java#L1266
Method invocation `id` may produce `NullPointerException`
Nullability and data flow problems: src/main/java/com/seailz/discordjar/utils/rest/DiscordRequest.java#L268
Argument `responseHeaders.get("X-RateLimit-Remaining")` might be null
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#L1521
Method invocation `id` may produce `NullPointerException`
Nullability and data flow problems: src/main/java/com/seailz/discordjar/DiscordJar.java#L1289
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/model/channel/GuildChannel.java#L50
Dereference of `permissionOverwrites()` may produce `NullPointerException`
Nullability and data flow problems: src/main/java/com/seailz/discordjar/utils/rest/DiscordRequest.java#L267
Argument `responseHeaders.get("X-RateLimit-Limit")` might be null
Nullability and data flow problems: src/main/java/com/seailz/discordjar/DiscordJar.java#L1244
Method invocation `id` may produce `NullPointerException`
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/model/invite/internal/InviteMetadataImpl.java#L81
Method invocation `compile` may produce `NullPointerException`
Nullability and data flow problems: src/main/java/com/seailz/discordjar/DiscordJar.java#L1219
Method invocation `id` may produce `NullPointerException`
Nullability and data flow problems: src/main/java/com/seailz/discordjar/DiscordJar.java#L1393
Method invocation `id` 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#L1166
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#L108
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#L302
Inner class `WebsocketExceptionError` may be 'static'
Inner class may be 'static': src/main/java/com/seailz/discordjar/ws/WebSocket.java#L314
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
Synchronization on a non-final field: src/main/java/com/seailz/discordjar/cache/Cache.java#L83
Synchronization on a non-final field `cache`
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/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/DiscordJar.java#L591
Variable `raw` initializer `null` is redundant
Unused assignment: src/main/java/com/seailz/discordjar/DiscordJar.java#L1249
Variable `res` 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/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#L694
Variable `raw` 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/interaction/Interaction.java#L190
Variable `compileMethod` initializer `null` is redundant
Unused assignment: src/main/java/com/seailz/discordjar/DiscordJar.java#L977
Variable `req` 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/DiscordJar.java#L490
Variable `response` initializer `null` is redundant
Unused assignment: src/main/java/com/seailz/discordjar/DiscordJar.java#L1349
Variable `res` 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/model/status/activity/Activity.java#L153
The value `null` assigned to `state` is never used
Unused assignment: src/main/java/com/seailz/discordjar/DiscordJar.java#L654
Variable `raw` initializer `null` is redundant
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/model/role/RoleTag.java#L30
Variable `availableForPurchase` initializer `false` 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#L819
Variable `response` initializer `null` is redundant
Unused assignment: src/main/java/com/seailz/discordjar/DiscordJar.java#L1488
Variable `res` initializer `null` is redundant
Unused assignment: src/main/java/com/seailz/discordjar/DiscordJar.java#L633
Variable `raw` initializer `null` is redundant
Unused assignment: src/main/java/com/seailz/discordjar/DiscordJar.java#L1193
Variable `res` 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/cache/Cache.java#L251
Variable `response` initializer `null` is redundant
Unused assignment: src/main/java/com/seailz/discordjar/DiscordJar.java#L1224
Variable `res` 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/DiscordJar.java#L570
Variable `raw` initializer `null` is redundant
Unused assignment: src/main/java/com/seailz/discordjar/DiscordJar.java#L612
Variable `raw` 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#L673
Variable `raw` 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/application/Application.java#L338
Variable `response` initializer `null` is redundant
Unused assignment: src/main/java/com/seailz/discordjar/DiscordJar.java#L1462
Variable `response` initializer `null` is redundant
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/utils/rest/DiscordRequest.java#L348
The value `json.getString("message")` assigned to `message` is never used
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#L549
Variable `raw` initializer `null` is redundant
Unused assignment: src/main/java/com/seailz/discordjar/model/message/Message.java#L601
Variable `res` initializer `null` is redundant
Unused assignment: src/main/java/com/seailz/discordjar/DiscordJar.java#L1526
Variable `res` initializer `null` is redundant
Unused assignment: src/main/java/com/seailz/discordjar/DiscordJar.java#L1317
Variable `res` 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/voice/ws/VoiceGatewayFactory.java#L72
Variable `udp` initializer `null` is redundant
Unused assignment: src/main/java/com/seailz/discordjar/DiscordJar.java#L1375
Variable `res` 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/model/permission/PermissionOverwrite.java#L76
Variable `denyList` initializer `null` is redundant
Analyze (java)
The following actions uses node12 which is deprecated and will be forced to run on node16: actions/setup-java@v1. For more info: https://github.blog/changelog/2023-06-13-github-actions-all-actions-will-run-on-node16-instead-of-node12-by-default/
Analyze (java)
The following actions use a deprecated Node.js version and will be forced to run on node20: actions/checkout@v3, actions/setup-java@v1, github/codeql-action/init@v2, github/codeql-action/autobuild@v2, github/codeql-action/analyze@v2. For more info: https://github.blog/changelog/2024-03-07-github-actions-all-actions-will-run-on-node20-instead-of-node16-by-default/
Analyze (java)
CodeQL Action v2 will be deprecated on December 5th, 2024. Please update all occurrences of the CodeQL Action in your workflow files to v3. For more information, see https://github.blog/changelog/2024-01-12-code-scanning-deprecation-of-codeql-action-v2/