iterative/dvc

View on GitHub
dvc/state.py

Summary

Maintainability
A
1 hr
Test Coverage

File state.py has 398 lines of code (exceeds 250 allowed). Consider refactoring.
Wontfix

"""Manages state database used for checksum caching."""
from __future__ import unicode_literals

import logging
import os
Severity: Minor
Found in dvc/state.py - About 5 hrs to fix

    State has 21 functions (exceeds 20 allowed). Consider refactoring.
    Wontfix

    class State(object):  # pylint: disable=too-many-instance-attributes
        """Class for the state database.
    
        Args:
            repo (dvc.repo.Repo): repo instance that this state belongs to.
    Severity: Minor
    Found in dvc/state.py - About 2 hrs to fix

      Function remove_unused_links has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
      Open

          def remove_unused_links(self, used):
              """Removes all saved links except the ones that are used.
      
              Args:
                  used (list): list of used links that should not be removed.
      Severity: Minor
      Found in dvc/state.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 load has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
      Open

          def load(self):
              """Loads state database."""
              retries = 1
              while True:
                  assert self.database is None
      Severity: Minor
      Found in dvc/state.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

      There are no issues that match your filters.

      Category
      Status