fabiocaccamo/python-fsutil

View on GitHub

Showing 21 of 27 total issues

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

def create_tar_file(
    path: PathIn,
    content_paths: list[PathIn],
    *,
    overwrite: bool = True,
Severity: Minor
Found in fsutil/__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 download_file has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

def download_file(
    url: str,
    *,
    dirpath: PathIn | None = None,
    filename: str | None = None,
Severity: Minor
Found in fsutil/__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 _read_file_lines_in_range has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

def _read_file_lines_in_range(
    path: PathIn,
    *,
    line_start: int = 0,
    line_end: int = -1,
Severity: Minor
Found in fsutil/__init__.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 transform_filepath has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

def transform_filepath(
    path: PathIn,
    *,
    dirpath: str | Callable[[str], str] | None = None,
    basename: str | Callable[[str], str] | None = None,
Severity: Minor
Found in fsutil/__init__.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 get_unique_name has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

def get_unique_name(
    path: PathIn,
    *,
    prefix: str = "",
    suffix: str = "",
Severity: Minor
Found in fsutil/__init__.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 read_file_lines has 7 arguments (exceeds 4 allowed). Consider refactoring.
Open

def read_file_lines(
Severity: Major
Found in fsutil/__init__.py - About 50 mins to fix

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

    def get_unique_name(
    Severity: Minor
    Found in fsutil/__init__.py - About 45 mins to fix

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

      def extract_tar_file(
      Severity: Minor
      Found in fsutil/__init__.py - About 45 mins to fix

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

        def write_file(
        Severity: Minor
        Found in fsutil/__init__.py - About 45 mins to fix

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

          def create_tar_file(
          Severity: Minor
          Found in fsutil/__init__.py - About 35 mins to fix

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

            def transform_filepath(
            Severity: Minor
            Found in fsutil/__init__.py - About 35 mins to fix

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

              def copy_file(
              Severity: Minor
              Found in fsutil/__init__.py - About 35 mins to fix

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

                def _write_file_atomic(
                Severity: Minor
                Found in fsutil/__init__.py - About 35 mins to fix

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

                  def extract_zip_file(
                  Severity: Minor
                  Found in fsutil/__init__.py - About 35 mins to fix

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

                    def _read_file_lines_in_range(
                    Severity: Minor
                    Found in fsutil/__init__.py - About 35 mins to fix

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

                      def _write_file_non_atomic(
                      Severity: Minor
                      Found in fsutil/__init__.py - About 35 mins to fix

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

                        def move_file(
                        Severity: Minor
                        Found in fsutil/__init__.py - About 35 mins to fix

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

                          def move_dir(
                          Severity: Minor
                          Found in fsutil/__init__.py - About 35 mins to fix

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

                            def copy_dir(
                            Severity: Minor
                            Found in fsutil/__init__.py - About 35 mins to fix

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

                              def create_zip_file(
                              Severity: Minor
                              Found in fsutil/__init__.py - About 35 mins to fix
                                Severity
                                Category
                                Status
                                Source
                                Language