File botplugin.py
has 705 lines of code (exceeds 250 allowed). Consider refactoring. Open
import logging
import re
import shlex
from io import IOBase
from threading import Timer, current_thread
Function recurse_check_structure
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
def recurse_check_structure(sample: Any, to_check: Any) -> None:
sample_type = type(sample)
to_check_type = type(to_check)
# Skip this check if the sample is None because it will always be something
- 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 send_card
has 11 arguments (exceeds 4 allowed). Consider refactoring. Open
def send_card(
Function send_templated
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def send_templated(
Function program_next_poll
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def program_next_poll(
Function send_stream_request
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def send_stream_request(
Function __init__
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(
Function start_poller
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def start_poller(
Function poller
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def poller(
Function start_poller
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def start_poller(
Function send
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def send(
Function __init__
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def __init__(
self,
function: Callable,
cmd_type: Optional[Callable] = None,
cmd_args=None,
- 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 poller
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def poller(
self,
interval: float,
method: Callable[..., None],
times: int = None,
- 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"