nstarman/utilipy

View on GitHub

Showing 95 of 96 total issues

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 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 __init__ has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

        def __init__(
            self,
            verbose: int = 0,
            sec_div: str = "-",
            header: T.Union[str, bool, None] = None,
    Severity: Minor
    Found in utilipy/utils/logging/_LogPrint.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 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

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

      def xmatch_fields(
          catalog: _TBL_TYPE, *others: _TBL_TYPE, fields: _FIELDS_TYPE
      ) -> T.Tuple[T.List[T.Any], _INFO_TYPE]:
          """Cross-match catalogs' data field(s) against a source catalog.
      
      
      Severity: Minor
      Found in utilipy/data_utils/crossmatch.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/_LogPrint.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 add_folder_backslash has 5 arguments (exceeds 4 allowed). Consider refactoring.
        Open

        def add_folder_backslash(
        Severity: Minor
        Found in utilipy/decorators/func_io.py - About 35 mins to fix

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

          def store_function_input(
          Severity: Minor
          Found in utilipy/decorators/func_io.py - About 35 mins to fix

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

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

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

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

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

                    def open_to_write(
                Severity: Minor
                Found in utilipy/utils/logging/_LogPrint.py - About 35 mins to fix

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

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

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

                    def printLTX(
                    Severity: Minor
                    Found in utilipy/ipython/printing.py - About 35 mins to fix

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

                          def register(
                      Severity: Minor
                      Found in utilipy/data_utils/xfm/graph.py - About 35 mins to fix

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

                            def load(
                        Severity: Minor
                        Found in utilipy/utils/collections.py - About 35 mins to fix

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

                              def function_decorator(
                          Severity: Minor
                          Found in utilipy/data_utils/xfm/graph.py - About 35 mins to fix

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

                                def __init__(
                            Severity: Minor
                            Found in utilipy/utils/collections.py - About 35 mins to fix

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

                                  def save(
                              Severity: Minor
                              Found in utilipy/utils/collections.py - About 35 mins to fix

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

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