dmyersturnbull/pocketutils

View on GitHub

Showing 96 of 96 total issues

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

    def __init__(
Severity: Minor
Found in src/pocketutils/core/exceptions.py - About 45 mins to fix

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

        def __init__(
    Severity: Minor
    Found in src/pocketutils/core/exceptions.py - About 45 mins to fix

      Function smart_log has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

          def smart_log(
              self: Self,
              is_stderr: bool,
              line: bytes,
              *,
      Severity: Minor
      Found in src/pocketutils/tools/call_tools.py - About 45 mins 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 sanitize_path has 6 arguments (exceeds 4 allowed). Consider refactoring.
      Open

          def sanitize_path(
      Severity: Minor
      Found in src/pocketutils/tools/path_tools.py - About 45 mins to fix

        Function add_reprs has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
        Open

        def add_reprs(
            fields: Collection[str] | None = None,
            *,
            exclude: Collection[str] | Callable[[str], bool] | None | Literal[False] = None,
            exclude_from_str: Collection[str] | Callable[[str], bool] | None = None,
        Severity: Minor
        Found in src/pocketutils/core/decorators.py - About 45 mins 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 encoder has 6 arguments (exceeds 4 allowed). Consider refactoring.
        Open

            def encoder(
        Severity: Minor
        Found in src/pocketutils/tools/json_tools.py - About 45 mins to fix

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

              def __init__(
          Severity: Minor
          Found in src/pocketutils/core/exceptions.py - About 45 mins to fix

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

                def __init__(
            Severity: Minor
            Found in src/pocketutils/core/exceptions.py - About 45 mins to fix

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

                  def __init__(
              Severity: Minor
              Found in src/pocketutils/core/exceptions.py - About 45 mins to fix

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

                    def __init__(
                Severity: Minor
                Found in src/pocketutils/core/exceptions.py - About 45 mins to fix

                  Consider simplifying this complex logical expression.
                  Open

                          if (
                              (is_list_with_inf or is_np_array_with_inf or is_list_with_nan or is_list_with_nan)
                              and inf_handling is NanInfHandling.convert_to_str
                              and nan_handling is NanInfHandling.convert_to_str
                          ):
                  Severity: Major
                  Found in src/pocketutils/tools/json_tools.py - About 40 mins to fix

                    Consider simplifying this complex logical expression.
                    Open

                            if (
                                (is_list_with_inf or is_np_array_with_inf)
                                and (is_list_with_nan or is_list_with_nan)
                                and inf_handling is NanInfHandling.convert_to_str
                                and nan_handling is NanInfHandling.convert_to_null
                    Severity: Major
                    Found in src/pocketutils/tools/json_tools.py - About 40 mins to fix

                      Consider simplifying this complex logical expression.
                      Open

                              if (
                                  (is_list_with_inf or is_np_array_with_inf)
                                  and (is_list_with_nan or is_list_with_nan)
                                  and inf_handling is NanInfHandling.convert_to_null
                                  and nan_handling is NanInfHandling.convert_to_str
                      Severity: Major
                      Found in src/pocketutils/tools/json_tools.py - About 40 mins to fix

                        Function smart_log has 5 arguments (exceeds 4 allowed). Consider refactoring.
                        Open

                            def smart_log(
                        Severity: Minor
                        Found in src/pocketutils/tools/call_tools.py - About 35 mins to fix

                          Function gen_html has 5 arguments (exceeds 4 allowed). Consider refactoring.
                          Open

                              def gen_html(
                          Severity: Minor
                          Found in src/pocketutils/core/decorators.py - About 35 mins to fix

                            Function __init__ has 5 arguments (exceeds 4 allowed). Consider refactoring.
                            Open

                                def __init__(
                            Severity: Minor
                            Found in src/pocketutils/core/exceptions.py - About 35 mins to fix

                              Function sanitize_nodes has 5 arguments (exceeds 4 allowed). Consider refactoring.
                              Open

                                  def sanitize_nodes(
                              Severity: Minor
                              Found in src/pocketutils/tools/path_tools.py - About 35 mins to fix

                                Function __init__ has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                Open

                                    def __init__(
                                Severity: Minor
                                Found in src/pocketutils/core/exceptions.py - About 35 mins to fix

                                  Function natsort has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                  Open

                                      def natsort(
                                  Severity: Minor
                                  Found in src/pocketutils/tools/sort_tools.py - About 35 mins to fix

                                    Function gen_str has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                    Open

                                        def gen_str(
                                    Severity: Minor
                                    Found in src/pocketutils/core/decorators.py - About 35 mins to fix
                                      Severity
                                      Category
                                      Status
                                      Source
                                      Language