bitranox/lib_log_utils

View on GitHub
lib_log_utils/lib_log_utils.py

Summary

Maintainability
D
2 days
Test Coverage
A
100%

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
Severity: Minor
Found in lib_log_utils/lib_log_utils.py - About 5 hrs to fix

    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,
    Severity: Minor
    Found in lib_log_utils/lib_log_utils.py - About 4 hrs to fix

    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 log_level has 7 arguments (exceeds 4 allowed). Consider refactoring.
    Open

    def log_level(
    Severity: Major
    Found in lib_log_utils/lib_log_utils.py - About 50 mins to fix

      Function banner_debug has 6 arguments (exceeds 4 allowed). Consider refactoring.
      Open

      def banner_debug(
      Severity: Minor
      Found in lib_log_utils/lib_log_utils.py - About 45 mins to fix

        Function log_verbose has 6 arguments (exceeds 4 allowed). Consider refactoring.
        Open

        def log_verbose(
        Severity: Minor
        Found in lib_log_utils/lib_log_utils.py - About 45 mins to fix

          Function banner_notice has 6 arguments (exceeds 4 allowed). Consider refactoring.
          Open

          def banner_notice(
          Severity: Minor
          Found in lib_log_utils/lib_log_utils.py - About 45 mins to fix

            Function log_debug has 6 arguments (exceeds 4 allowed). Consider refactoring.
            Open

            def log_debug(
            Severity: Minor
            Found in lib_log_utils/lib_log_utils.py - About 45 mins to fix

              Function log_warning has 6 arguments (exceeds 4 allowed). Consider refactoring.
              Open

              def log_warning(
              Severity: Minor
              Found in lib_log_utils/lib_log_utils.py - About 45 mins to fix

                Function banner_spam has 6 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                def banner_spam(
                Severity: Minor
                Found in lib_log_utils/lib_log_utils.py - About 45 mins to fix

                  Function log_spam has 6 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                  def log_spam(
                  Severity: Minor
                  Found in lib_log_utils/lib_log_utils.py - About 45 mins to fix

                    Function log_success has 6 arguments (exceeds 4 allowed). Consider refactoring.
                    Open

                    def log_success(
                    Severity: Minor
                    Found in lib_log_utils/lib_log_utils.py - About 45 mins to fix

                      Function log_info has 6 arguments (exceeds 4 allowed). Consider refactoring.
                      Open

                      def log_info(
                      Severity: Minor
                      Found in lib_log_utils/lib_log_utils.py - About 45 mins to fix

                        Function banner_verbose has 6 arguments (exceeds 4 allowed). Consider refactoring.
                        Open

                        def banner_verbose(
                        Severity: Minor
                        Found in lib_log_utils/lib_log_utils.py - About 45 mins to fix

                          Function banner_success has 6 arguments (exceeds 4 allowed). Consider refactoring.
                          Open

                          def banner_success(
                          Severity: Minor
                          Found in lib_log_utils/lib_log_utils.py - About 45 mins to fix

                            Function banner_critical has 6 arguments (exceeds 4 allowed). Consider refactoring.
                            Open

                            def banner_critical(
                            Severity: Minor
                            Found in lib_log_utils/lib_log_utils.py - About 45 mins to fix

                              Function log_critical has 6 arguments (exceeds 4 allowed). Consider refactoring.
                              Open

                              def log_critical(
                              Severity: Minor
                              Found in lib_log_utils/lib_log_utils.py - About 45 mins to fix

                                Function banner_warning has 6 arguments (exceeds 4 allowed). Consider refactoring.
                                Open

                                def banner_warning(
                                Severity: Minor
                                Found in lib_log_utils/lib_log_utils.py - About 45 mins to fix

                                  Function log_notice has 6 arguments (exceeds 4 allowed). Consider refactoring.
                                  Open

                                  def log_notice(
                                  Severity: Minor
                                  Found in lib_log_utils/lib_log_utils.py - About 45 mins to fix

                                    Function banner_error has 6 arguments (exceeds 4 allowed). Consider refactoring.
                                    Open

                                    def banner_error(
                                    Severity: Minor
                                    Found in lib_log_utils/lib_log_utils.py - About 45 mins to fix

                                      Function banner_info has 6 arguments (exceeds 4 allowed). Consider refactoring.
                                      Open

                                      def banner_info(
                                      Severity: Minor
                                      Found in lib_log_utils/lib_log_utils.py - About 45 mins to fix

                                        Function log_error has 6 arguments (exceeds 4 allowed). Consider refactoring.
                                        Open

                                        def log_error(
                                        Severity: Minor
                                        Found in lib_log_utils/lib_log_utils.py - About 45 mins to fix

                                          There are no issues that match your filters.

                                          Category
                                          Status