dmyersturnbull/pocketutils

View on GitHub

Showing 96 of 96 total issues

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

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

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

              Avoid too many return statements within this function.
              Open

                          return list(obj)
              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 wraps(func)(my_fn)
                Severity: Major
                Found in src/pocketutils/core/decorators.py - About 30 mins to fix

                  Avoid too many return statements within this function.
                  Open

                              return obj.tzname(datetime.now(tz=obj))
                  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 dict(obj)
                        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 "⟨" + 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 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") + "." + str(round(then.microsecond / 1000))
                                Severity: Major
                                Found in src/pocketutils/tools/unit_tools.py - About 30 mins to fix
                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language