Showing 56 of 56 total issues
Function __call__
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def __call__(self,
Function __init__
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(self,
Function mk_inventory_dirs
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def mk_inventory_dirs(self,
dirs: Iterable[Path] | Path) -> list[Path]:
r"""Create inventory directories `dirs`.
Creates `dirs` including anchor files.
- 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 fsck
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def fsck(repo: OnyoRepo,
tests: list[str] | None = None) -> None:
r"""Run a suite of integrity checks on an Onyo repository and its contents.
By default, the following tests are performed:
- 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
Avoid too many return
statements within this function. Open
return contains_all_comments(b_comment, a_comment) and contains_all_comments(a_comment, b_comment)
Avoid too many return
statements within this function. Open
return True
Avoid too many return
statements within this function. Open
return False
Avoid too many return
statements within this function. Open
return asset_value == self.value or self._re_match(str(asset_value), self.value)
Function check_ignore
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def check_ignore(self, ignore: Path, paths: list[Path]) -> list[Path]:
r"""Get the `paths` that are matched by patterns defined in `ignore`.
This is utilizing ``git-check-ignore`` to evaluate `paths` against
a file `ignore`, that defines exclude patterns the gitignore-way.
- 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_pending_removals
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def _get_pending_removals(self,
mode: Literal['assets', 'dirs', 'all'] = 'all') -> list[Path]:
r"""Get paths that are removed by pending operations.
Parameters
- 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
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def get(args: argparse.Namespace) -> None:
r"""
Return values of the requested **KEY**\ s for matching assets.
If no **KEY**\ s are given, the path and all keys in the asset name are
- 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_asset_content
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def get_asset_content(asset_file: Path) -> dict[str, bool | float | int | str | Path]:
r"""Get the contents of an asset as a dictionary.
If the asset file's contents are not valid YAML, an error is printed.
- 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_config
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def get_config(self,
name: str,
file_: Path | None = None) -> str | None:
r"""Get the value for a configuration option specified by `name`.
- 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 _keys
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def _keys(self) -> Generator[str, None, None]:
"""Recursively yield all keys from nested dicts in dot notation.
Note, that this forces the returned keys to be strings no matter their original type.
"""
- 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_template
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def get_template(self,
path: Path | str | None = None) -> dict:
r"""Select a template file and return an asset dict from it.
from the directory `.onyo/templates/`
- 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_asset_content
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def get_asset_content(self,
path: Path) -> dict:
r"""Get a dictionary representing `path`'s content.
Parameters
- 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"