iScrE4m/IdiotechDiscordBot

View on GitHub

Showing 31 of 31 total issues

Function __init__ has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

    def __init__(self, game, countdown, channel, owner, bot):
Severity: Minor
Found in cogs/giveaway.py - About 35 mins to fix

Function create_msg has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

def create_msg(game, days, hrs, mins, maxlen):
Severity: Minor
Found in helpers/time_calculations.py - About 35 mins to fix

Function get_total has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    def get_total(self, table):
        if table is "ga":
            all = self.db.query(GiveawaysDB).all()
            total = 0
            for one in all:
Severity: Minor
Found in cogs/stats.py - About 35 mins to fix

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

Function release_dates has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    def release_dates(self, game_list):
        dates = {}
        for release_date in game_list:
            name = release_date
            hour = 0
Severity: Minor
Found in cogs/games.py - About 35 mins to fix

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

Function stomp_confusables has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

def stomp_confusables(input_string):
    output_string = ""
    for char in input_string:
        for confusable_line in Swear.confusables:
            if char in confusable_line:
Severity: Minor
Found in cogs/swear.py - About 25 mins to fix

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

TODO found
Open

                # TODO Make Uploaded in ago format
Severity: Minor
Found in cogs/general.py by fixme

TODO found
Open

        # TODO Use api to pull latest tweet(s?) https://dev.twitter.com/rest/public
Severity: Minor
Found in cogs/general.py by fixme

TODO found
Open

                # TODO Make date ago
Severity: Minor
Found in cogs/general.py by fixme

TODO found
Open

        # TODO Squish timezones into one command (here)
Severity: Minor
Found in cogs/general.py by fixme

TODO found
Open

# TODO eventually test if this indeed is broken in the class, for some reason ER says he thinks it was
Severity: Minor
Found in cogs/giveaway.py by fixme

TODO found
Open

        # TODO Decide whether to use the full currency names somewhere or not
Severity: Minor
Found in cogs/currency.py by fixme
Severity
Category
Status
Source
Language