nstarman/utilipy

View on GitHub

Showing 95 of 96 total issues

Function open has 13 arguments (exceeds 4 allowed). Consider refactoring.
Open

    def open(
Severity: Major
Found in utilipy/utils/logging/_LogFile.py - About 1 hr to fix

    Function merge_section has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
    Open

    def merge_section(
        key: str,
        prnt_sec: T.Union[str, None],
        child_sec: T.Union[str, None],
        method: T.Union[Literal["merge"], Literal["replace"]] = "replace",
    Severity: Minor
    Found in utilipy/extern/doc_parse_tools/numpy_parse_tools.py - About 1 hr 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 random_generator_from_seed has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
    Open

    def random_generator_from_seed(
        function: T.Callable = None,
        seed_names: T.Union[str, T.Sequence[str]] = ("random", "random_seed"),
        generator: T.Callable = np.random.RandomState,
        raise_if_not_int: bool = False,
    Severity: Minor
    Found in utilipy/decorators/func_io.py - About 1 hr 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 merge_section has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
    Open

    def merge_section(
        key: str,
        prnt_sec: T.Union[str, None],
        child_sec: T.Union[str, None],
        style: str,
    Severity: Minor
    Found in utilipy/extern/doc_parse_tools/napoleon_parse_tools.py - About 1 hr 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 parse_rest_doc has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
    Open

    def parse_rest_doc(doc: T.Union[str, None]) -> T.Dict[str, Section]:
        """Extract the headers, delimiters, and text from reST-formatted docstrings.
    
        Parameters
        ----------
    Severity: Minor
    Found in utilipy/extern/doc_parse_tools/rest_parse_tools.py - About 1 hr 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 update_wrapper has 12 arguments (exceeds 4 allowed). Consider refactoring.
    Open

    def update_wrapper(
    Severity: Major
    Found in utilipy/utils/functools.py - About 1 hr to fix

      Function idxDecorator has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
      Open

      def idxDecorator(
          function: T.Optional[T.Callable] = None,
          *,
          as_ind: T.Union[bool, Literal["flatten"]] = False,
          _doc_fmt: T.Optional[dict] = None,  # ibid
      Severity: Minor
      Found in utilipy/data_utils/decorators.py - About 1 hr 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 run_imports has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
      Open

      def run_imports(
          *files: str,
          is_relative: bool = True,
          # standard import files
          base: bool = False,
      Severity: Minor
      Found in utilipy/ipython/imports.py - About 1 hr 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 dump has 10 arguments (exceeds 4 allowed). Consider refactoring.
      Open

      def dump(
      Severity: Major
      Found in utilipy/utils/pickle.py - About 1 hr to fix

        Function _inRange has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
        Open

        def _inRange(
            x: np.array, rng: T.Sequence, lbi: bool = True, ubi: bool = False
        ) -> np.array:
            """`inRange` helper function.
        
        
        Severity: Minor
        Found in utilipy/data_utils/select.py - About 1 hr 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 make_function has 9 arguments (exceeds 4 allowed). Consider refactoring.
        Open

        def make_function(
        Severity: Major
        Found in utilipy/utils/functools.py - About 1 hr to fix

          Function load has 9 arguments (exceeds 4 allowed). Consider refactoring.
          Open

          def load(
          Severity: Major
          Found in utilipy/utils/pickle.py - About 1 hr to fix

            Function __new__ has 28 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                def __new__(cls: type, name: str, bases: tuple, dct: dict):
                    """Set properties for new decorator class.
            
                    define an `__init__` method and store original docs
            
            
            Severity: Minor
            Found in utilipy/decorators/baseclass.py - About 1 hr to fix

              Function write has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
              Open

                  def write(
                      self,
                      *text: str,
                      start: str = "",
                      sep: str = " ",
              Severity: Minor
              Found in utilipy/utils/logging/_LogPrint.py - About 1 hr 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 parse_numpy_doc has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
              Open

              def parse_numpy_doc(doc):
                  """Extract the text from the sections of a numpy-formatted docstring.
              
                  Parameters
                  ----------
              Severity: Minor
              Found in utilipy/extern/doc_parse_tools/numpy_parse_tools.py - About 1 hr 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 online_help has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
              Open

              def online_help(query: T.Union[None, str, T.Any] = None, version=__version__):
                  """Search the online documentation for the given query.
              
                  Opens the results in the default web browser.
                  Requires an active internet connection.
              Severity: Minor
              Found in utilipy/__init__.py - About 1 hr 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 printLTX has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
              Open

              def printLTX(
                  s: str,
                  math: T.Union[str, bool] = False,
                  equation: T.Union[str, bool] = False,
                  matrix: T.Union[str, bool] = False,
              Severity: Minor
              Found in utilipy/ipython/printing.py - About 1 hr 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 find_shortest_path has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
              Open

                  def find_shortest_path(self, fromtype, totype):
                      """Compute shortest path along graph from one system to another.
              
                      Parameters
                      ----------
              Severity: Minor
              Found in utilipy/data_utils/xfm/graph.py - About 1 hr 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 printMD has 8 arguments (exceeds 4 allowed). Consider refactoring.
              Open

              def printMD(
              Severity: Major
              Found in utilipy/ipython/printing.py - About 1 hr to fix

                Function open_to_read has 8 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                    def open_to_read(
                Severity: Major
                Found in utilipy/utils/logging/_LogFile.py - About 1 hr to fix
                  Severity
                  Category
                  Status
                  Source
                  Language