deeplime-io/onecode

View on GitHub

Showing 26 of 26 total issues

Avoid deeply nested control flow statements.
Open

                    if verbose:
                        print(f"Archiving {output['key']}: {output_file} => {arcpath}")

Severity: Major
Found in onecode/cli/zip.py - About 45 mins to fix

    Avoid deeply nested control flow statements.
    Open

                        if os.path.exists(output_file):
                            zf.write(
                                output_file,
                                arcname=arcpath
                            )
    Severity: Major
    Found in onecode/cli/zip.py - About 45 mins to fix

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

      def zip_output(
      Severity: Minor
      Found in onecode/cli/zip.py - About 35 mins to fix

        Function create has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
        Open

        def create(
            project_path: str,
            name: str,
            main_flow_name: str = None,
            cli: bool = True
        Severity: Minor
        Found in onecode/cli/create.py - About 25 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 main has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
        Open

        def main(cli: bool = True) -> None:    # pragma: no cover
            """
            ```bash
            usage: onecode-extract [-h] [--all] [--modules [MODULES [MODULES ...]]] [--path PATH]
                [--verbose] output_file
        Severity: Minor
        Found in onecode/cli/extract.py - About 25 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 reset has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
        Open

            def reset(
                self,
                keep_registered_elements: bool = False
            ):
                """
        Severity: Minor
        Found in onecode/base/project.py - About 25 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

        Severity
        Category
        Status
        Source
        Language