Showing 155 of 224 total issues
Function flows_status
has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring. Open
def flows_status(self, msg, args):
"""Displays the list of started flows."""
with io.StringIO() as response:
if not self._bot.flow_executor.in_flight:
response.write("No Flow started.\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"
Further reading
Function execute
has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring. Open
def execute(self, flow: Flow) -> None:
"""
This is where the flow execution happens from one of the thread of the pool.
"""
while True:
- 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 __str__
has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring. Open
def __str__(self):
nbcols = max(len(row) for row in chain(self.headers, self.rows))
maxes = [
0,
] * nbcols
- 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 serve_forever
has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring. Open
def serve_forever(self) -> None:
self.readline_support()
if not self._rooms:
# artificially join a room if None were specified.
- 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 open
has 98 lines of code (exceeds 25 allowed). Consider refactoring. Open
open: function (group, opts) {
if (!group) {
return;
}
Function _start
has 98 lines of code (exceeds 25 allowed). Consider refactoring. Open
_start: function (index) {
var coming = {},
obj,
href,
type,
Function bot_config_defaults
has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring. Open
def bot_config_defaults(config: object) -> None:
if not hasattr(config, "ACCESS_CONTROLS_DEFAULT"):
config.ACCESS_CONTROLS_DEFAULT = {}
if not hasattr(config, "ACCESS_CONTROLS"):
config.ACCESS_CONTROLS = {}
- 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 setup_bot
has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring. Open
def setup_bot(
backend_name: str,
logger: logging.Logger,
config: object,
restore: Optional[str] = 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
File cli.py
has 312 lines of code (exceeds 250 allowed). Consider refactoring. Open
#!/usr/bin/env python
# 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
# the Free Software Foundation; either version 3 of the License, or
Function _afterLoad
has 86 lines of code (exceeds 25 allowed). Consider refactoring. Open
_afterLoad: function () {
var coming = F.coming,
previous = F.current,
placeholder = 'fancybox-placeholder',
current,
Function acls
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
def acls(self, msg, cmd, args, dry_run):
"""
Check command against ACL rules as defined in the bot configuration.
:param msg: The original chat message.
- 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 plugins.py
has 298 lines of code (exceeds 250 allowed). Consider refactoring. Open
import logging
import os
import shutil
from ast import literal_eval
from pprint import pformat
Function run
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
def run(self):
"""streams to all the clients synchronously"""
nb_clients = len(self.clients)
pipes = [
(io.open(r, "rb"), io.open(w, "wb"))
- 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 _tag_botcmd
has 23 arguments (exceeds 4 allowed). Consider refactoring. Open
def _tag_botcmd(
IRCConnection
has 25 functions (exceeds 20 allowed). Consider refactoring. Open
class IRCConnection(SingleServerIRCBot):
def __init__(
self,
bot,
nickname,
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 _replace_charref
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
def _replace_charref(s):
s = s.group(1)
if s[0] == "#":
# numeric charref
if s[1] in "xX":
- 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
XMPPBackend
has 24 functions (exceeds 20 allowed). Consider refactoring. Open
class XMPPBackend(ErrBot):
room_factory = XMPPRoom
roomoccupant_factory = XMPPRoomOccupant
def __init__(self, config):
Function apropos
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
def apropos(self, msg, args):
"""Returns a help string listing available options.
Automatically assigned to the "help" command."""
if not args:
- 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 repos_update
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
def repos_update(self, _, args):
"""update the bot and/or plugins
use: !repos update all
to update everything
or: !repos update repo_name repo_name ...
- 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"