Showing 12 of 140 total issues
File SFXManagerView.java
has 267 lines of code (exceeds 250 allowed). Consider refactoring. Open
package com.expiredminotaur.bcukbot.web.view.commands;
import com.expiredminotaur.bcukbot.Role;
import com.expiredminotaur.bcukbot.sql.sfx.SFX;
import com.expiredminotaur.bcukbot.sql.sfx.SFXCategory;
- Create a ticketCreate a ticket
JustGivingSettings
has 21 methods (exceeds 20 allowed). Consider refactoring. Open
public class JustGivingSettings
{
@Transient
private static final String fileName = "justgiving.json";
private Boolean autoCheckEnabled = false;
- Create a ticketCreate a ticket
Method loadAndPlay
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
public void loadAndPlay(MessageCreateEvent event, final String trackUrl)
{
playerManager.loadItemOrdered(player, trackUrl, new AudioLoadResultHandler()
{
@Override
- Create a ticketCreate a ticket
Method loadAndPlayPriority
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
public void loadAndPlayPriority(final String trackUrl)
{
playerManager.loadItemOrdered(player, trackUrl, new AudioLoadResultHandler()
{
@Override
- Create a ticketCreate a ticket
Method updateData
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
private void updateData(String data)
{
this.data = data;
JsonElement jsonTree = JsonParser.parseString(data);
if (jsonTree.isJsonObject())
- Create a ticketCreate a ticket
Method update
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public void update(Group group, Stream newStream)
{
if (stream == null)
{
stream = newStream;
- Read upRead up
- Create a ticketCreate a ticket
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Method correctAnswerPost
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
private void correctAnswerPost(MessageChannel channel, Questions.Question question, ReactionEmoji.Unicode emoji, String answer, List<User> correct)
- Create a ticketCreate a ticket
Method update
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
private void update(Message message, EmbedCreateSpec embed, Outcome outcome, String[] display, int i)
- Create a ticketCreate a ticket
Method addMinecraftWhitelist
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
private String addMinecraftWhitelist(Long discordID, String username)
{
NameWithUUID newUser = UuidApi.nameToUUID(username);
if (newUser != null)
{
- Read upRead up
- Create a ticketCreate a ticket
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Method checkBannedPhrases
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public boolean checkBannedPhrases(TwitchCommandEvent event)
{
if (TwitchPermissions.subPlus(event))
return false;
else
- Read upRead up
- Create a ticketCreate a ticket
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Method play
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public void play(String cmd)
{
long time = System.currentTimeMillis();
if (time - lastSFX > settings.getSfxDelay() * 1000L)
{
- Read upRead up
- Create a ticketCreate a ticket
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Method onChannelMessage
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private void onChannelMessage(ChannelMessageEvent event)
{
TwitchCommandEvent cEvent = new TwitchCommandEvent(event);
if (!banHandler.checkBannedPhrases(cEvent))
{
- Read upRead up
- Create a ticketCreate a ticket
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"