Showing 9 of 31 total issues
File games.py
has 335 lines of code (exceeds 250 allowed). Consider refactoring. Open
import asyncio
import logging
import bs4
import requests
import json
- Create a ticketCreate a ticket
Function find_value
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
def find_value(stats, name):
"""
:param stats: stats list
:param name: name of value to find (i.e. Games Won)
:return: largest value for name (there are multiple game won's but the biggest will be the overall games won
- 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
Function check_swears
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def check_swears(self, message, content):
swear_count = 0
message_words = content.split()
for bad_word in Swear.swears:
bad_word = bad_word.strip()
- 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
Avoid deeply nested control flow statements. Open
if str(login) != "Normal" and str(community) != "Normal" and str(economy) != "Normal":
reply = "Steam might be having some issues, use `!steam status! for more info."
# elif login is "normal" and community is "normal" and economy is "normal":
# reply = "Steam is running fine - no issues detected, use `!steam status! for more info."
else:
- Create a ticketCreate a ticket
Function __init__
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(self, game, countdown, channel, owner, bot):
- Create a ticketCreate a ticket
Function create_msg
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def create_msg(game, days, hrs, mins, maxlen):
- Create a ticketCreate a ticket
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
- 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
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:
- 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
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:
- 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"