Showing 18 of 18 total issues
File bot.py
has 566 lines of code (exceeds 250 allowed). Consider refactoring. Open
# Yami - A command handler that complements Hikari.
# Copyright (C) 2021-present Jonxslays
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
File context.py
has 332 lines of code (exceeds 250 allowed). Consider refactoring. Open
# Yami - A command handler that complements Hikari.
# Copyright (C) 2021-present Jonxslays
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
File commands.py
has 329 lines of code (exceeds 250 allowed). Consider refactoring. Open
# Yami - A command handler that complements Hikari.
# Copyright (C) 2021-present Jonxslays
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
File checks.py
has 328 lines of code (exceeds 250 allowed). Consider refactoring. Open
# Yami - A command handler that complements Hikari.
# Copyright (C) 2021-present Jonxslays
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
Bot
has 27 functions (exceeds 20 allowed). Consider refactoring. Open
class Bot(hikari.GatewayBot):
"""A subclass of :obj:`~hikari.impl.bot.GatewayBot` that provides an
interface for handling commands.
This is the class you will instantiate to utilize command features
Function add_command
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def add_command(
self,
command: typing.Callable[..., typing.Any] | commands_.MessageCommand,
*,
name: str | None = 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 __init__
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(
Function subcommand
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def subcommand(
Function __init__
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(
Function command
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def command(
Function add_command
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def add_command(
Function command
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def command(
Function load_all_modules
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def load_all_modules(self, *paths: str | Path, recursive: bool = True) -> None:
"""Loads all modules from each of the given paths.
.. note::
This method looks for all ``.py`` files that do not begin
- 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 add_subcommand
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def add_subcommand(
Function __init__
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(
Function __init__
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(
Function add_subcommand
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def add_subcommand(
self,
command: typing.Callable[..., typing.Any] | MessageCommand,
*,
name: str | None = 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 unload_module
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def unload_module(self, name: str) -> modules_.Module:
"""Unloads a single module class with the given name. It will
remain in :obj:`Bot.modules`, but just in an unloaded state and
its commands will no longer be executable until it is loaded
again.
- 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"