Showing 43 of 43 total issues
File starboard.py
has 949 lines of code (exceeds 250 allowed). Consider refactoring. Open
import asyncio
import collections
import datetime
import logging
import re
File moderation.py
has 759 lines of code (exceeds 250 allowed). Consider refactoring. Open
import asyncio
import contextlib
import datetime
import functools
import heapq
File modlog.py
has 538 lines of code (exceeds 250 allowed). Consider refactoring. Open
import asyncio
import collections
import contextlib
import enum
import json
File sudoku.py
has 450 lines of code (exceeds 250 allowed). Consider refactoring. Open
import asyncio
import enum
import functools
import itertools
import random
File permissions.py
has 364 lines of code (exceeds 250 allowed). Consider refactoring. Open
import itertools
import random
from collections import defaultdict, namedtuple
import asyncpg
File bot.py
has 348 lines of code (exceeds 250 allowed). Consider refactoring. Open
import asyncio
import collections
import contextlib
import importlib
import inspect
File paginator.py
has 322 lines of code (exceeds 250 allowed). Consider refactoring. Open
import asyncio
import collections
import contextlib
import functools
import itertools
File currency.py
has 320 lines of code (exceeds 250 allowed). Consider refactoring. Open
import collections
import enum
import io
import math
import random
Function jumps_from
has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring. Open
def jumps_from(self, square):
"""Generates all jumps from a particular square in the current position."""
board = self._board
captures = _CAPTURES[board[square]]
- 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
ValePy
has 26 functions (exceeds 20 allowed). Consider refactoring. Open
class ValePy(commands.AutoShardedBot):
__version__ = '0.0.2a'
version_info = VersionInfo(major=0, minor=0, micro=2, releaselevel='alpha', serial=0)
def __init__(self):
File base.py
has 282 lines of code (exceeds 250 allowed). Consider refactoring. Open
import asyncio
import contextlib
import enum
import functools
import inspect
Function _load_emojis
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
def _load_emojis(self):
import emoji
emoji_cache = {}
- 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 cache
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
def cache(max_size=128, make_key=default_key):
def decorator(func):
if max_size is None:
cache = {}
get_stats = lambda: (0, 0)
- 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
File help.py
has 264 lines of code (exceeds 250 allowed). Consider refactoring. Open
import copy
import inspect
import itertools
import operator
import random
File tags.py
has 257 lines of code (exceeds 250 allowed). Consider refactoring. Open
import itertools
import logging
import asyncpg
import discord
Function __init_subclass__
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
def __init_subclass__(cls, stop_emoji='\N{BLACK SQUARE FOR STOP}', stop_pattern=None, stop_fallback='exit', **kwargs):
super().__init_subclass__(**kwargs)
cls._reaction_map = callbacks = collections.OrderedDict()
cls._message_callbacks = message_callbacks = []
- 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 _changelog_versions
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def _changelog_versions(lines):
version = change_type = release_date = None
changes = {}
for line in lines:
line = line.strip()
- 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 get_example
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def get_example(converter, ctx):
"""Returns a random example based on the converter."""
if hasattr(converter, 'random_example'):
return converter.random_example(ctx)
- 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 _parameter_examples
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def _parameter_examples(parameters, ctx, command=None):
command = command or ctx.command
def parameter_example(parameter):
ctx._current_parameter = parameter
- 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 _make_board
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def _make_board(m=3):
"""Returns a randomly filled m**2 x m**2 Sudoku board."""
n = m * m
nn = n * n
- 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"