Showing 547 of 589 total issues
Function _
has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring. Open
def _(obj: dict, config=None): # noqa: C901
config = config or {}
result = ""
for k, v in flatten(obj).items():
- 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
File stage.py
has 338 lines of code (exceeds 250 allowed). Consider refactoring. Open
import fnmatch
import typing
from collections.abc import Iterable
from contextlib import suppress
from functools import wraps
File plots.py
has 337 lines of code (exceeds 250 allowed). Consider refactoring. Open
import argparse
import os
from typing import TYPE_CHECKING, Optional
from funcy import compact, first, get_in
File config_schema.py
has 336 lines of code (exceeds 250 allowed). Consider refactoring. Open
import os
from urllib.parse import urlparse
from funcy import once, walk_values
from voluptuous import (
_DVCFileSystem
has 32 functions (exceeds 20 allowed). Consider refactoring. Open
class _DVCFileSystem(AbstractFileSystem):
cachable = False
root_marker = "/"
def __init__( # noqa: PLR0913
TabularData
has 32 functions (exceeds 20 allowed). Consider refactoring. Open
class TabularData(MutableSequence[Sequence["CellT"]]):
def __init__(self, columns: Sequence[str], fill_value: Optional[str] = ""):
self._columns: dict[str, Column] = {name: Column() for name in columns}
self._keys: list[str] = list(columns)
self._fill_value = fill_value
File dvcfile.py
has 333 lines of code (exceeds 250 allowed). Consider refactoring. Open
import contextlib
import os
from typing import TYPE_CHECKING, Any, Callable, ClassVar, Optional, TypeVar, Union
from dvc.exceptions import DvcException
File datasets.py
has 331 lines of code (exceeds 250 allowed). Consider refactoring. Open
import os
from collections.abc import Iterator, Mapping
from datetime import datetime
from functools import cached_property
from pathlib import Path
File show.py
has 330 lines of code (exceeds 250 allowed). Consider refactoring. Open
import typing
from collections import Counter
from collections.abc import Iterable
from typing import Optional, Union
Function _check_blockers
has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring. Open
def _check_blockers(tmp_dir, lock, info, *, mode, waiters): # noqa: C901, PLR0912
from .lock import LockError
non_existing_pid = set()
- 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 run
has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring. Open
def run( # noqa: C901, PLR0912
repo,
targets: Optional[Iterable[str]] = None,
params: Optional[Iterable[str]] = None,
run_all: 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 format
has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring. Open
def format(self, record) -> str: # noqa: C901
record.message = record.getMessage()
msg = self.formatMessage(record)
if record.levelno == logging.INFO:
- 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
File remote_tests.py
has 323 lines of code (exceeds 250 allowed). Consider refactoring. Open
import os
import shutil
import pytest
Function gc
has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring. Open
def gc( # noqa: C901, PLR0912, PLR0913
self: "Repo",
all_branches: bool = False,
cloud: bool = False,
remote: Optional[str] = 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 ls
has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring. Open
def ls(self, path, detail=True, dvc_only=False, **kwargs): # noqa: C901, PLR0912
key = self._get_key_from_relative(path)
repo, dvc_fs, subkey = self._get_subrepo_info(key)
dvc_infos = {}
- 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 drop_duplicates
has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring. Open
def drop_duplicates( # noqa: C901
self,
axis: str = "rows",
subset: Optional[Iterable[str]] = None,
ignore_empty: 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
File show.py
has 321 lines of code (exceeds 250 allowed). Consider refactoring. Open
from collections import Counter, defaultdict
from collections.abc import Iterable, Iterator, Mapping
from datetime import date, datetime
from typing import TYPE_CHECKING, Any, Literal, NamedTuple, Optional, Union
File artifacts.py
has 317 lines of code (exceeds 250 allowed). Consider refactoring. Open
import os
import posixpath
from pathlib import Path
from typing import TYPE_CHECKING, Any, Optional, Union
Function dropna
has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring. Open
def dropna( # noqa: C901, PLR0912
self,
axis: str = "rows",
how="any",
subset: Optional[Iterable[str]] = 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
File data_cloud.py
has 310 lines of code (exceeds 250 allowed). Consider refactoring. Open
"""Manages dvc remotes that user can use with push/pull/status commands."""
from collections.abc import Iterable
from typing import TYPE_CHECKING, Optional