File __init__.py
has 599 lines of code (exceeds 250 allowed). Consider refactoring. Wontfix
import logging
import os
import string
from collections import defaultdict
from contextlib import suppress
Stage
has 64 functions (exceeds 20 allowed). Consider refactoring. Wontfix
class Stage(params.StageParams):
# pylint:disable=no-value-for-parameter
# rwlocked() confuses pylint
def __init__(
Function run
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Wontfix
def run(
self,
dry=False,
no_commit=False,
force=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 __init__
has 15 arguments (exceeds 4 allowed). Consider refactoring. Wontfix
def __init__(
Function commit
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def commit(self, allow_missing=False, filter_info=None):
from dvc.output import OutputDoesNotExistError
link_failures = []
for out in self.filter_outs(filter_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
Function reproduce
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def reproduce(self, interactive=False, **kwargs):
if not (kwargs.get("force", False) or self.changed()):
if not isinstance(self, PipelineStage) and self.is_data_source:
logger.info("'%s' didn't change, skipping", self.addressing)
else:
- 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 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def run(
Function loads_from
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def loads_from(cls, repo, path, wdir, data):
Function create_stage
has 5 arguments (exceeds 4 allowed). Consider refactoring. Wontfix
def create_stage(cls, repo, path, external=False, **kwargs):
Function save_outs
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def save_outs(self, allow_missing=False):
from dvc.output import OutputDoesNotExistError
for out in self.outs:
try:
- 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
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def merge(self, ancestor, other):
assert other
if not other.outs:
return
- 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 save_deps
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def save_deps(self, allow_missing=False):
from dvc.dependency.base import DependencyDoesNotExistError
for dep in self.deps:
try:
- 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"