Showing 529 of 589 total issues
Function log_result
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def log_result(result: dict[str, Any], remote: str):
from dvc.utils import humanize
def join_exps(exps):
return humanize.join([f"[bold]{e}[/]" for e in exps])
- 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 _merge_info
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def _merge_info(repo, key, fs_info, dvc_info):
from . import utils
ret = {"repo": repo}
- 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 _compute_meta_hash_info_from_files
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def _compute_meta_hash_info_from_files(self) -> None:
if self.files:
tree = Tree.from_list(self.files, hash_name=self.hash_name)
tree.digest(with_meta=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 display
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def display(self, name: str, dataset: "Dataset", new: "Dataset"):
from dvc.commands.checkout import log_changes
from dvc.ui import ui
action = "Updating"
- 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 9 (exceeds 5 allowed). Consider refactoring. Open
def _get(self, remote_or_db, section, opt):
from dvc.config import ConfigError
levels = self._get_appropriate_levels(self.args.level)[::-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 plain_table
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def plain_table(
Function rich_table
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def rich_table(
Function du
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def du(
Function update_import
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def update_import(
Function build_data_index
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def build_data_index( # noqa: C901, PLR0912
Function save
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def save(
Function _build_rows
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def _build_rows(
Function _reproduce
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def _reproduce(
Function get_url
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def get_url(url, out=None, *, fs_config=None, jobs=None, force=False, config=None):
Function used_objs
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def used_objs(
Function __init__
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(
Function get
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def get(
Function checkout
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def checkout(
Function show_metrics
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def show_metrics(
Avoid deeply nested control flow statements. Open
if last_rev:
result[last_rev] = info.asdict()
except (InvalidRemoteSCMRepo, SCMError):