iterative/dvc

View on GitHub
dvc/repo/stage.py

Summary

Maintainability
C
1 day
Test Coverage

File stage.py has 340 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import fnmatch
import logging
import typing
from contextlib import suppress
from functools import wraps
Severity: Minor
Found in dvc/repo/stage.py - About 4 hrs to fix

    Function collect_granular has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
    Open

        def collect_granular(
            self,
            target: str = None,
            with_deps: bool = False,
            recursive: bool = False,
    Severity: Minor
    Found in dvc/repo/stage.py - About 1 hr to fix

    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 create has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
    Open

        def create(
            self,
            single_stage: bool = False,
            validate: bool = True,
            fname: str = None,
    Severity: Minor
    Found in dvc/repo/stage.py - About 55 mins to fix

    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 _collect_specific_target has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

    def _collect_specific_target(
        loader: "StageLoad",
        target: str,
        with_deps: bool,
        recursive: bool,
    Severity: Minor
    Found in dvc/repo/stage.py - About 45 mins to fix

    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 add has 6 arguments (exceeds 4 allowed). Consider refactoring.
    Open

        def add(
    Severity: Minor
    Found in dvc/repo/stage.py - About 45 mins to fix

      Function create has 5 arguments (exceeds 4 allowed). Consider refactoring.
      Open

          def create(
      Severity: Minor
      Found in dvc/repo/stage.py - About 35 mins to fix

        Function collect has 5 arguments (exceeds 4 allowed). Consider refactoring.
        Open

            def collect(
        Severity: Minor
        Found in dvc/repo/stage.py - About 35 mins to fix

          Function collect has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
          Open

              def collect(
                  self,
                  target: str = None,
                  with_deps: bool = False,
                  recursive: bool = False,
          Severity: Minor
          Found in dvc/repo/stage.py - About 25 mins to fix

          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

          There are no issues that match your filters.

          Category
          Status