Showing 529 of 589 total issues
Function split_file_meta_from_cloud
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def split_file_meta_from_cloud(entry: dict) -> dict:
if remote_name := entry.pop(Meta.PARAM_REMOTE, None):
remote_meta = {}
for key in (S3_PARAM_CHECKSUM, HDFS_PARAM_CHECKSUM, Meta.PARAM_VERSION_ID):
if value := entry.pop(key, 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 _log_exceptions
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def _log_exceptions(exc: Exception) -> Optional[int]:
"""Try to log some known exceptions, that are not DVCExceptions."""
from dvc.utils import error_link, format_link
if isinstance(exc, OSError):
- 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 _build_tree_structure
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def _build_tree_structure(
Function get_obj
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def get_obj(
self, filter_info: Optional[str] = None, **kwargs
) -> Optional["HashFile"]:
obj: Optional[HashFile] = None
if self.obj:
- 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
Consider simplifying this complex logical expression. Open
if (change.old and change.old.isdir and not change.old.hash_info) or (
change.new and change.new.isdir and not change.new.hash_info
):
continue
Consider simplifying this complex logical expression. Open
if exc.context_mark is not None and (
exc.problem is None
or exc.problem_mark is None
or exc.context_mark.name != exc.problem_mark.name
or exc.context_mark.line != exc.problem_mark.line
Consider simplifying this complex logical expression. Open
if remote is not None and remote_config is not None:
conf = erepo.get("config") or {}
core = conf.get("core") or {}
core["remote"] = remote
Function sync_import
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def sync_import(stage, dry=False, force=False, jobs=None, no_download=False):
Function run_stage
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def run_stage(stage, dry=False, force=False, run_env=None, **kwargs):
Function init_executor
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def init_executor(
Function _push
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def _push(
Function status
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def status(
Function rename
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def rename(
Function line
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def line(self, x0, y0, x1, y1, char): # noqa: C901, PLR0912
Function _repro_commit
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def _repro_commit(
Function ls
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def ls(
Function transfer
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def transfer(
Function transfer
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def transfer(
Function _pull_cache
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def _pull_cache(
Function _reproduce_entry
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def _reproduce_entry(