maduck/GoWDiscordTeamBot

View on GitHub
command_registry.py

Summary

Maintainability
F
3 days
Test Coverage

File command_registry.py has 1271 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import asyncio
import re
from enum import Enum

import aiohttp
Severity: Major
Found in command_registry.py - About 3 days to fix

    Too many arguments (6/5)
    Open

    async def add_slash_command(bot_id,
    Severity: Info
    Found in command_registry.py by pylint

    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?
    Severity: Minor
    Found in command_registry.py by pylint

    Used when a warning note as FIXME or XXX is detected.

    Unable to import 'aiohttp'
    Open

    import aiohttp
    Severity: Critical
    Found in command_registry.py by pylint

    Used when pylint has been unable to import a module.

    Line too long (103/100)
    Open

            async with session.post(url, headers={"Authorization": f"Bot {bot_token}"}, json=base) as resp:
    Severity: Info
    Found in command_registry.py by pylint

    Used when a line is longer than a given number of characters.

    Too many lines in module (1291/1000)
    Open

    import asyncio
    Severity: Info
    Found in command_registry.py by pylint

    Used when a module has too many lines, reducing its readability.

    Wrong hanging indentation (remove 4 spaces).
    Open

                        + r'(?P<prefix>.)tower (?P<floor>\d+) (?P<scroll_ii>[^ ]+) (?P<scroll_iii>[^ ]+) '
    Severity: Info
    Found in command_registry.py by pylint

    TODO + r'(?P<prefix>.)tower (?P<floor>d+) (?P<scroll_ii>[^ ]+) (?P<scroll_iii>[^ ]+) ' | ^</scroll_iii></scroll_ii></floor></prefix>

    Missing module docstring
    Open

    import asyncio
    Severity: Info
    Found in command_registry.py by pylint

    Used when a module has no docstring.Empty modules do not require a docstring.

    Line too long (109/100)
    Open

                    'description': 'Date of weapon release, format MONTH-DAY with two digits each (e.g. 12-25). '
    Severity: Info
    Found in command_registry.py by pylint

    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>[^ ]+)$',
    Severity: Info
    Found in command_registry.py by pylint

    Used when a line is longer than a given number of characters.

    Constant name aliases doesn't conform to UPPER_CASE naming style
    Open

    aliases = {
    Severity: Info
    Found in command_registry.py by pylint

    Used when the name doesn't conform to naming rules associated to its type (constant, variable, class...).

    Line too long (107/100)
    Open

                    return await add_slash_command(bot_id, bot_token, guild_id, cmd_name, description, options)
    Severity: Info
    Found in command_registry.py by pylint

    Used when a line is longer than a given number of characters.

    Consider iterating the dictionary directly instead of calling .keys()
    Open

                        for k in PetRescueConfig.DEFAULT_CONFIG.keys()
    Severity: Info
    Found in command_registry.py by pylint

    Emitted when the keys of a dictionary are iterated through the .keys() method. It is enough to just iterate through the dictionary itself, as in for key in dictionary.

    Line too long (102/100)
    Open

                        + r'(?P<prefix>.)tower (?P<floor>\d+) (?P<scroll_ii>[^ ]+) (?P<scroll_iii>[^ ]+) '
    Severity: Info
    Found in command_registry.py by pylint

    Used when a line is longer than a given number of characters.

    Line too long (120/100)
    Open

                f'{DEFAULT_PATTERN}toplist update (?P<toplist_id>[a-zA-Z0-9]+) (?P<description>[^,]+)? (?P<items>(.+,?)+)$',
    Severity: Info
    Found in command_registry.py by pylint

    Used when a line is longer than a given number of characters.

    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})?\]
    Severity: Info
    Found in command_registry.py by pylint

    Used when a line is longer than a given number of characters.

    Missing class docstring
    Open

    class OptionType(Enum):
    Severity: Info
    Found in command_registry.py by pylint

    Used when a class has no docstring.Even an empty class must have a docstring.

    Line too long (107/100)
    Open

                f'{DEFAULT_PATTERN}towerconfig (?P<category>(rooms|scrolls)) (?P<field>[^ ]+) (?P<values>.+)$',
    Severity: Info
    Found in command_registry.py by pylint

    Used when a line is longer than a given number of characters.

    Wrong hanging indentation (remove 4 spaces).
    Open

                        f'^{LANG_PATTERN}'
    Severity: Info
    Found in command_registry.py by pylint

    TODO f'^{LANG_PATTERN}' | ^

    There are no issues that match your filters.

    Category
    Status