dmyersturnbull/pocketutils

View on GitHub

Showing 96 of 96 total issues

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

    def stream_cmd_call(
Severity: Minor
Found in src/pocketutils/tools/call_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 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 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

              Function _re_leaf has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
              Open

                  def _re_leaf(cls: type[Self], at: str, items: Mapping[str, Any]) -> Iterable[tuple[str, Any]]:
                      for k, v in items.items():
                          me = at + "." + k if len(at) > 0 else k
                          if hasattr(v, "items") and hasattr(v, "keys") and hasattr(v, "values"):
                              yield from cls._re_leaf(me, v)
              Severity: Minor
              Found in src/pocketutils/core/dot_dict.py - About 35 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 status has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
              Open

              def status(level: int | str | CodeStatus, vr: str | None = "", msg: str | None = None) -> Callable[..., Any]:
                  """
                  Annotate code quality. Emits a warning if bad code is called.
              
                  Args:
              Severity: Minor
              Found in src/pocketutils/core/decorators.py - About 35 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 normalize has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
              Open

                  def normalize(self: Self) -> Self:
                      s = ""
                      if self.append:
                          s += "a"
                      elif self.safe:
              Severity: Minor
              Found in src/pocketutils/core/input_output.py - About 35 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 _un_leaf has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
              Open

                  def _un_leaf(cls: type[Self], to: MutableMapping[str, Any], items: Mapping[str, Any]) -> None:
                      for k, v in items.items():
                          if "." not in k:
                              to[k] = v
                          else:
              Severity: Minor
              Found in src/pocketutils/core/dot_dict.py - About 35 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

              Avoid too many return statements within this function.
              Open

                          return "⟨" + s + addr + "⟩"
              Severity: Major
              Found in src/pocketutils/tools/string_tools.py - About 30 mins to fix

                Avoid too many return statements within this function.
                Open

                            return obj._asdict()
                Severity: Major
                Found in src/pocketutils/tools/json_tools.py - About 30 mins to fix

                  Avoid too many return statements within this function.
                  Open

                              return data.tolist()
                  Severity: Major
                  Found in src/pocketutils/tools/json_tools.py - About 30 mins to fix

                    Avoid too many return statements within this function.
                    Open

                                return [self.prepare(e, inf_handling=inf_handling, nan_handling=nan_handling) for e in data]
                    Severity: Major
                    Found in src/pocketutils/tools/json_tools.py - About 30 mins to fix

                      Avoid too many return statements within this function.
                      Open

                                  return str(data)
                      Severity: Major
                      Found in src/pocketutils/tools/json_tools.py - About 30 mins to fix

                        Avoid too many return statements within this function.
                        Open

                                return s
                        Severity: Major
                        Found in src/pocketutils/tools/string_tools.py - About 30 mins to fix

                          Avoid too many return statements within this function.
                          Open

                                  return str(thing)
                          Severity: Major
                          Found in src/pocketutils/tools/string_tools.py - About 30 mins to fix

                            Avoid too many return statements within this function.
                            Open

                                    return then.strftime(_today + "%H:%M:%S.%f")
                            Severity: Major
                            Found in src/pocketutils/tools/unit_tools.py - About 30 mins to fix

                              Avoid too many return statements within this function.
                              Open

                                          return then.strftime(_today + "%H:%M:%S")
                              Severity: Major
                              Found in src/pocketutils/tools/unit_tools.py - About 30 mins to fix

                                Avoid too many return statements within this function.
                                Open

                                            return obj.Self
                                Severity: Major
                                Found in src/pocketutils/tools/json_tools.py - About 30 mins to fix
                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language