Showing 37 of 37 total issues
File lib_log_utils.py
has 381 lines of code (exceeds 250 allowed). Consider refactoring. Open
# STDLIB
from typing import Optional, Union
import logging
import logging.handlers
File lib_log_utils_cli.py
has 351 lines of code (exceeds 250 allowed). Consider refactoring. Open
# STDLIB
import logging
import os
import sys
from typing import Optional
Function log_level
has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring. Open
def log_level(
message: str,
level: Optional[int] = None,
width: Optional[int] = None,
wrap: Optional[bool] = 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 log_handlers.py
has 267 lines of code (exceeds 250 allowed). Consider refactoring. Open
# STDLIB
import logging
import logging.handlers
import getpass
import os
Function set_width_from_env
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
def set_width_from_env(width: Optional[int] = None, force: bool = False) -> None:
# env settings have precedence, unless force=True - if nothing is passed, the default value will be used
"""
>>> # Setup
>>> default_banner_width = log_settings.width
- 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 cli_main
has 13 arguments (exceeds 4 allowed). Consider refactoring. Open
def cli_main(
Function set_extended_from_env
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def set_extended_from_env(extended: Optional[bool] = None, force: bool = False) -> None:
# env settings have precedence, unless force=True - if nothing is passed, the default value will be used
"""
>>> # Setup
>>> default_fmt = log_settings.fmt
- 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 set_wrap_from_env
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def set_wrap_from_env(wrap_text: Optional[bool] = None, force: bool = False) -> None:
# env settings have precedence, unless force=True - if nothing is passed, the default value will be used
"""
>>> # Setup
>>> default_wrap_text = log_settings.wrap
- 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 set_quiet_from_env
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def set_quiet_from_env(quiet: Optional[bool] = None, force: bool = False) -> None:
# env settings have precedence, unless force=True - if nothing is passed, the default value will be used
# parameter -q is anything else then "True" (not case sensitive), or not set, it is considered as False.
"""
>>> # Setup
- 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 do_log
has 10 arguments (exceeds 4 allowed). Consider refactoring. Open
def do_log(
Function set_file_handler
has 10 arguments (exceeds 4 allowed). Consider refactoring. Open
def set_file_handler(
Function set_stream_handler_color
has 9 arguments (exceeds 4 allowed). Consider refactoring. Open
def set_stream_handler_color(
Function set_stream_handler
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def set_stream_handler(
Function log_level
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def log_level(
Function banner_debug
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def banner_debug(
Function log_verbose
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def log_verbose(
Function banner_notice
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def banner_notice(
Function log_debug
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def log_debug(
Function log_warning
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def log_warning(
Function banner_spam
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def banner_spam(