iterative/dvc

View on GitHub
dvc/stage/__init__.py

Summary

Maintainability
B
4 hrs
Test Coverage

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
Severity: Major
Found in dvc/stage/__init__.py - About 1 day to fix

    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__(
    Severity: Major
    Found in dvc/stage/__init__.py - About 1 day to fix

      Function run has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
      Wontfix

          def run(
              self,
              dry=False,
              no_commit=False,
              force=False,
      Severity: Minor
      Found in dvc/stage/__init__.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 __init__ has 15 arguments (exceeds 4 allowed). Consider refactoring.
      Wontfix

          def __init__(
      Severity: Major
      Found in dvc/stage/__init__.py - About 1 hr to fix

        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):
        Severity: Minor
        Found in dvc/stage/__init__.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 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:
        Severity: Minor
        Found in dvc/stage/__init__.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 run has 5 arguments (exceeds 4 allowed). Consider refactoring.
        Open

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

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

          def loads_from(cls, repo, path, wdir, data):
          Severity: Minor
          Found in dvc/stage/__init__.py - About 35 mins to fix

            Function create_stage has 5 arguments (exceeds 4 allowed). Consider refactoring.
            Wontfix

            def create_stage(cls, repo, path, external=False, **kwargs):
            Severity: Minor
            Found in dvc/stage/__init__.py - About 35 mins to fix

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

              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:
              Severity: Minor
              Found in dvc/stage/__init__.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