iterative/dvc

View on GitHub
dvc/repo/stage.py

Summary

Maintainability
D
1 day
Test Coverage

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

import fnmatch
import logging
import os
import time
import typing
Severity: Minor
Found in dvc/repo/stage.py - About 5 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 _collect_repo has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
    Open

        def _collect_repo(self, onerror: Callable[[str, Exception], None] = None):
            """Collects all of the stages present in the DVC repo.
    
            Args:
                onerror (optional): callable that will be called with two args:
    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 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 collect has 6 arguments (exceeds 4 allowed). Consider refactoring.
      Open

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

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

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

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

              def collect_granular(
          Severity: Minor
          Found in dvc/repo/stage.py - About 35 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 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