Showing 281 of 281 total issues
Function __task_name_replacements
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def __task_name_replacements(self, task, color, lang):
replacements = {
'{WeaponType}': '[WEAPONTYPE_{c:u}]',
'{Kingdom}': '[{d:u}_NAME]',
'{Banner}': '[{c:u}_BANNERNAME]',
- Read upRead up
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 populate_troop_release_dates
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def populate_troop_release_dates(self):
release: dict
for release in self.user_data['pEconomyModel']['TroopReleaseDates']:
troop_id = release['TroopId']
release_date = self.get_datetime(release['Date'])
- Read upRead up
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 translate_weapon
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def translate_weapon(self, weapon, lang):
weapon['name'] = _(weapon['name'], lang)
weapon['description'] = _(weapon['description'], lang)
weapon['color_code'] = "".join(sorted(weapon['colors']))
weapon['spell_title'] = _('[TROOPHELP_SPELL0]', lang)
- Read upRead up
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 translate_toplist
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def translate_toplist(self, toplist_id, lang):
toplist = self.toplists.get(toplist_id)
if not toplist:
return None
result = toplist.copy()
- Read upRead up
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
Line too long (109/100) Open
'description': 'Date of weapon release, format MONTH-DAY with two digits each (e.g. 12-25). '
- Read upRead up
- Exclude checks
Used when a line is longer than a given number of characters.
Too many arguments (7/5) Open
def __init__(self, author, guild, channel, content, interaction_id=None, interaction_token=None):
- Read upRead up
- Exclude checks
Used when a function or method takes too many arguments.
TODO adapt to something more strict, maybe this? Open
# TODO adapt to something more strict, maybe this?
- Read upRead up
- Exclude checks
Used when a warning note as FIXME or XXX is detected.
Line too long (107/100) Open
return await add_slash_command(bot_id, bot_token, guild_id, cmd_name, description, options)
- Read upRead up
- Exclude checks
Used when a line is longer than a given number of characters.
Missing module docstring Open
import asyncio
- Read upRead up
- Exclude checks
Used when a module has no docstring.Empty modules do not require a docstring.
Constant name aliases
doesn't conform to UPPER_CASE naming style Open
aliases = {
- Read upRead up
- Exclude checks
Used when the name doesn't conform to naming rules associated to its type (constant, variable, class...).
Variable name x
doesn't conform to snake_case naming style Open
x, y = kingdom['coordinates']
- Read upRead up
- Exclude checks
Used when the name doesn't conform to naming rules associated to its type (constant, variable, class...).
Missing module docstring Open
from game_constants import TROOP_RARITIES
- Read upRead up
- Exclude checks
Used when a module has no docstring.Empty modules do not require a docstring.
Wrong hanging indentation (remove 4 spaces). Open
+ r'(?P<prefix>.)tower (?P<floor>\d+) (?P<scroll_ii>[^ ]+) (?P<scroll_iii>[^ ]+) '
- Read upRead up
- Exclude checks
TODO + r'(?P<prefix>.)tower (?P<floor>d+) (?P<scroll_ii>[^ ]+) (?P<scroll_iii>[^ ]+) ' | ^</scroll_iii></scroll_ii></floor></prefix>
Line too long (120/100) Open
# \[(?P<weapon_troops>([167]\d{3},?)+){1,4}(?P<banner>3\d{3},?)?(?P<talents>([0-3]{1},?){7})?(?P<class>\d{5})?\]
- Read upRead up
- Exclude checks
Used when a line is longer than a given number of characters.
Missing module docstring Open
import io
- Read upRead up
- Exclude checks
Used when a module has no docstring.Empty modules do not require a docstring.
Unable to import 'wand.color' Open
from wand.color import Color
- Read upRead up
- Exclude checks
Used when pylint has been unable to import a module.
Variable name y
doesn't conform to snake_case naming style Open
x, y = kingdom['coordinates']
- Read upRead up
- Exclude checks
Used when the name doesn't conform to naming rules associated to its type (constant, variable, class...).
Missing function or method docstring Open
def send(self, *args, **kwargs):
- Read upRead up
- Exclude checks
Used when a function or method has no docstring.Some special methods like init do not require a docstring.
Line too long (119/100) Open
filenames = LANG_FILES + ['World.json', 'User.json', 'Campaign.json', 'Soulforge.json', 'Event.json', 'Store.json']
- Read upRead up
- Exclude checks
Used when a line is longer than a given number of characters.
Line too long (101/100) Open
f'^{LANG_PATTERN}(?P<prefix>.)tower (?P<floor>[^ ]+) (?P<room>[^ ]+) (?P<scroll>[^ ]+)$',
- Read upRead up
- Exclude checks
Used when a line is longer than a given number of characters.