nstarman/utilipy

View on GitHub

Showing 95 of 96 total issues

Function ioRange has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring.
Open

def ioRange(
    incl: T.Union[None, tuple, np.array] = None,
    excl: T.Union[None, tuple, np.array] = None,
    rng: T.Union[T.Sequence, EllipsisType] = Ellipsis,
) -> np.array:
Severity: Minor
Found in utilipy/data_utils/select.py - About 5 hrs 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 remove_transform has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring.
Open

    def remove_transform(self, fromtype, totype, transform):
        """Removes a data transform from the graph.

        .. todo::

Severity: Minor
Found in utilipy/data_utils/xfm/graph.py - About 4 hrs 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

FullerSignature has 33 functions (exceeds 20 allowed). Consider refactoring.
Open

class FullerSignature(Signature):
    """Signature with better ArgSpec compatibility.

    Constructs FullerSignature from the given list of Parameter
    objects and 'return_annotation'.  All arguments are optional.
Severity: Minor
Found in utilipy/utils/inspect.py - About 4 hrs to fix

    Function __call__ has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
    Open

        def __call__(self, wrapped_func: T.Callable) -> T.Callable:
            """Make Decorator.
    
            Parameters
            ----------
    Severity: Minor
    Found in utilipy/decorators/func_io.py - About 3 hrs 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 indev has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
    Open

    def indev(
        message: T.Union[str, T.Callable] = "",
        name: str = "",
        alternative: str = "",
        todo: str = "",
    Severity: Minor
    Found in utilipy/decorators/code_dev.py - About 3 hrs 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 __call__ has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
    Open

        def __call__(self, wrapped_func: T.Callable) -> T.Callable:
            """Wrap function.
    
            Works by making a wrapper which will convert input and
            output arguments to the specified data type.
    Severity: Minor
    Found in utilipy/decorators/func_io.py - About 2 hrs 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_folder_backslash has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
    Open

    def add_folder_backslash(
        function=None,
        *,
        arguments: T.List[T.Union[str, int]] = [],
        _doc_style="numpy",
    Severity: Minor
    Found in utilipy/decorators/func_io.py - About 2 hrs 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_napoleon_doc has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
    Open

    def parse_napoleon_doc(doc: T.Union[str, None], style: str):
        """Extract the text from the sections of a numpy-formatted docstring.
    
        Parameters
        ----------
    Severity: Minor
    Found in utilipy/extern/doc_parse_tools/napoleon_parse_tools.py - About 2 hrs 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 a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
    Open

    def update_wrapper(
        wrapper: T.Callable,
        wrapped: T.Callable,
        signature: T.Union[_FullerSig, None, bool] = True,  # not in functools
        docstring: T.Union[str, bool] = True,  # not in functools
    Severity: Minor
    Found in utilipy/utils/functools.py - About 2 hrs 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 __new__ has a Cognitive Complexity of 18 (exceeds 5 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 2 hrs 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 19 arguments (exceeds 4 allowed). Consider refactoring.
    Open

    def run_imports(
    Severity: Major
    Found in utilipy/ipython/imports.py - About 2 hrs to fix

      Function function_decorator has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
      Open

          def function_decorator(
              self,
              function: T.Optional[T.Callable] = None,
              *,
              _doc_style: str = "numpy",
      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 _cached_names has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
      Open

          def _cached_names(self):
              if self._cached_names_dct is None:
                  self._cached_names_dct = dct = {}
                  for c in self.type_set:
                      nm = getattr(c, "name", None)
      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 __init__ has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
      Open

          def __init__(cls: type, name: str, bases: tuple, dct: dict):
              """__init__ method for MetaClass.
      
              Sets up docstring inheritance.
      
      
      Severity: Minor
      Found in utilipy/decorators/baseclass.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_update_sig has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
      Open

      def __update_wrapper_update_sig(
          signature: T.Union[_FullerSig, None, bool],
          wrapper_sig: _FullerSig,
          _doc_fmt: T.Optional[dict],
      ) -> T.Callable:
      Severity: Minor
      Found in utilipy/utils/functools.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 add_var_positional_parameter has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
      Open

          def add_var_positional_parameter(
              self, name: str = "args", index: T.Optional[int] = None
          ):
              """Add var positional parameter.
      
      
      Severity: Minor
      Found in utilipy/utils/inspect.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 __init__ has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
      Open

          def __init__(cls, name: str, bases: T.Any, dct: T.Dict):
              """Set up docstring inheritance."""
      
              def is_public_member(key):
                  return (
      Severity: Minor
      Found in utilipy/utils/metaclasses.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 open_to_write has 13 arguments (exceeds 4 allowed). Consider refactoring.
      Open

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

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

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

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

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