nstarman/utilipy

View on GitHub

Showing 95 of 96 total issues

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

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

    Function merge_all_sections has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
    Open

    def merge_all_sections(
        prnt_sctns: T.MutableMapping[str, T.Union[None, str]],
        child_sctns: T.MutableMapping[str, T.Union[None, str]],
        method: T.Union[Literal["merge"], Literal["replace"]] = "replace",
    ) -> T.Union[str, None]:
    Severity: Minor
    Found in utilipy/extern/doc_parse_tools/numpy_parse_tools.py - About 55 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 a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
    Open

        def __init__(self, fromtype, totype, priority=1, register_graph=None):
            if not inspect.isclass(fromtype) and fromtype is not None:
                raise TypeError("fromtype must be a class")
            if not inspect.isclass(totype) and totype is not None:
                raise TypeError("totype must be a class")
    Severity: Minor
    Found in utilipy/data_utils/xfm/transformations.py - About 55 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 report has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
    Open

        def report(
            self,
            *msgs: str,
            verbose: T.Optional[int] = None,
            print: bool = True,
    Severity: Minor
    Found in utilipy/utils/logging/_LogPrint.py - About 55 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 make_help_function has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
    Open

    def make_help_function(
        name: str,
        module: T.Union[None, ModuleType, str] = None,
        look_for: T.Optional[str] = None,  # "Routine Listings",
        doctitle: T.Optional[str] = None,
    Severity: Minor
    Found in utilipy/utils/misc.py - About 55 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 __new__ has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
    Open

        def __new__(
            cls: type, function: T.Optional[T.Callable] = None, **kwargs: T.Any
        ):
            """Make new DecoratorBaseClass.
    
    
    Severity: Minor
    Found in utilipy/decorators/baseclass.py - About 55 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 idxDecorator has 7 arguments (exceeds 4 allowed). Consider refactoring.
    Open

    def idxDecorator(
    Severity: Major
    Found in utilipy/data_utils/decorators.py - About 50 mins to fix

      Function write has 7 arguments (exceeds 4 allowed). Consider refactoring.
      Open

          def write(
      Severity: Major
      Found in utilipy/utils/logging/_LogFile.py - About 50 mins to fix

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

            def __init__(
        Severity: Major
        Found in utilipy/data_utils/xfm/transformations.py - About 50 mins to fix

          Function write has 7 arguments (exceeds 4 allowed). Consider refactoring.
          Open

              def write(
          Severity: Major
          Found in utilipy/utils/logging/_LogPrint.py - About 50 mins to fix

            Function read_log has 7 arguments (exceeds 4 allowed). Consider refactoring.
            Open

                def read_log(
            Severity: Major
            Found in utilipy/utils/logging/_LogPrint.py - About 50 mins to fix

              Function wraps has 7 arguments (exceeds 4 allowed). Consider refactoring.
              Open

              def wraps(
              Severity: Major
              Found in utilipy/utils/functools.py - About 50 mins to fix

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

                def merge_all_sections(
                    prnt_sctns: T.MutableMapping[str, T.Union[None, str]],
                    child_sctns: T.MutableMapping[str, T.Union[None, str]],
                    style: str,
                    method: T.Union[Literal["merge"], Literal["replace"]] = "replace",
                Severity: Minor
                Found in utilipy/extern/doc_parse_tools/napoleon_parse_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 import_from_file has 6 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                def import_from_file(
                Severity: Minor
                Found in utilipy/ipython/imports.py - About 45 mins to fix

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

                  def modify_parameter(
                  Severity: Minor
                  Found in utilipy/utils/inspect.py - About 45 mins to fix

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

                    def indev(
                    Severity: Minor
                    Found in utilipy/decorators/code_dev.py - About 45 mins to fix

                      Avoid deeply nested control flow statements.
                      Open

                                              for i in range(len(q)):
                                                  if q[i][2] == n2:
                                                      break
                                              else:
                                                  raise ValueError(
                      Severity: Major
                      Found in utilipy/data_utils/xfm/graph.py - About 45 mins to fix

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

                        def import_from_file(
                            *files: str,
                            is_relative: bool = True,
                            verbose_imports: T.Optional[bool] = None,
                            logger: LogFile = _LOGFILE,
                        Severity: Minor
                        Found in utilipy/ipython/imports.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 report has 6 arguments (exceeds 4 allowed). Consider refactoring.
                        Open

                            def report(
                        Severity: Minor
                        Found in utilipy/utils/logging/_LogFile.py - About 45 mins to fix

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

                              def record(
                          Severity: Minor
                          Found in utilipy/utils/logging/_LogPrint.py - About 45 mins to fix
                            Severity
                            Category
                            Status
                            Source
                            Language