File __init__.py
has 1284 lines of code (exceeds 250 allowed). Consider refactoring. Wontfix
from __future__ import annotations
import glob
import hashlib
import json
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,
- Read upRead up
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 create_zip_file
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Wontfix
def create_zip_file(
path: PathIn,
content_paths: list[PathIn],
*,
overwrite: bool = True,
- Read upRead up
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,
- Read upRead up
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,
- Read upRead up
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 = "",
- Read upRead up
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,
- Read upRead up
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(
Function extract_tar_file
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def extract_tar_file(
Function download_file
has 6 arguments (exceeds 4 allowed). Consider refactoring. Wontfix
def download_file(
Function get_unique_name
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def get_unique_name(
Function write_file
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def write_file(
Function copy_dir
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def copy_dir(
Function transform_filepath
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def transform_filepath(
Function move_dir
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def move_dir(
Function _write_file_atomic
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def _write_file_atomic(
Function create_tar_file
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def create_tar_file(
Function write_file_json
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def write_file_json(
Function extract_zip_file
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def extract_zip_file(
Function _write_file_non_atomic
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def _write_file_non_atomic(
Function copy_file
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def copy_file(
Function move_file
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def move_file(
Function create_zip_file
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def create_zip_file(
Function _read_file_lines_in_range
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def _read_file_lines_in_range(
Function _write_file_atomic
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def _write_file_atomic(
path: PathIn,
content: str,
*,
append: bool = False,
- Read upRead up
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 _clean_dir_empty_dirs
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Wontfix
def _clean_dir_empty_dirs(path: PathIn) -> None:
path = _get_path(path)
for basepath, dirnames, _ in os.walk(path, topdown=False):
for dirname in dirnames:
dirpath = os.path.join(basepath, dirname)
- Read upRead up
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_dir_size
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Wontfix
def get_dir_size(path: PathIn) -> int:
"""
Get the directory size in bytes.
"""
path = _get_path(path)
- Read upRead up
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 _clean_dir_empty_files
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Wontfix
def _clean_dir_empty_files(path: PathIn) -> None:
path = _get_path(path)
for basepath, _, filenames in os.walk(path, topdown=False):
for filename in filenames:
filepath = os.path.join(basepath, filename)
- Read upRead up
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"