dmyersturnbull/pocketutils

View on GitHub

Showing 96 of 96 total issues

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

    def format_pint_quantity(
Severity: Minor
Found in src/pocketutils/tools/unit_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 dict_to_str has 6 arguments (exceeds 4 allowed). Consider refactoring.
        Open

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

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

              def strip_any_ends(self: Self, s: str, prefixes: str | Sequence[str], suffixes: str | Sequence[str]) -> str:
                  """
                  Flexible variant that strips any number of prefixes and any number of suffixes.
                  Also less type-safe than more specific variants.
                  Note that the order of the prefixes (or suffixes) DOES matter.
          Severity: Minor
          Found in src/pocketutils/tools/string_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 log_called_process_error has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
          Open

              def log_called_process_error(self: Self, e: CalledProcessError, *, log_fn: Callable[[str], None]) -> None:
                  """
                  Outputs some formatted text describing the error with its full stdout and stderr.
          
                  Args:
          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 pretty_function has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
          Open

              def pretty_function(self: Self, function: Callable, *, with_addr: bool = False) -> str:
                  n_args = str(function.__code__.co_argcount) if hasattr(function, "__code__") else "?"
                  pat = re.compile(r"^<bound method [^ .]+\.([^ ]+) of (.+)>$")
                  boundmatch = pat.fullmatch(str(function))
                  addr = " @ " + hex(id(function)) if with_addr else ""
          Severity: Minor
          Found in src/pocketutils/tools/string_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 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 __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)
                          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

                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 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

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

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

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

                          def approx_time_wrt(
                      Severity: Minor
                      Found in src/pocketutils/tools/unit_tools.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 __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 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_list has 5 arguments (exceeds 4 allowed). Consider refactoring.
                              Open

                                  def gen_list(
                              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
                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language