iterative/dvc

View on GitHub

Showing 158 of 278 total issues

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

def gc(
    self,
    all_branches=False,
    cloud=False,
    remote=None,
Severity: Minor
Found in dvc/repo/gc.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_metrics has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
Open

def _collect_metrics(repo, targets, recursive):
    metrics = set()

    for stage in repo.stages:
        for out in stage.outs:
Severity: Minor
Found in dvc/repo/metrics/show.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 execute has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

    def execute(self, cmd):
        stdin, stdout, stderr = self._ssh.exec_command(cmd)
        channel = stdout.channel

        stdin.close()
Severity: Minor
Found in dvc/remote/ssh/connection.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 _load_from_revisions has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

def _load_from_revisions(repo, datafile, revisions):
    data = []
    exceptions = []

    for rev in repo.brancher(revs=revisions):
Severity: Minor
Found in dvc/repo/plots/data.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 main has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

def main(argv=None):
    """Run dvc CLI command.

    Args:
        argv: optional list of arguments to parse. sys.argv is used by default.
Severity: Minor
Found in dvc/main.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 12 arguments (exceeds 4 allowed). Consider refactoring.
Open

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

    Function _get_active_graph has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
    Open

    def _get_active_graph(G):
        import networkx as nx
    
        active = G.copy()
        for stage in G:
    Severity: Minor
    Found in dvc/repo/reproduce.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 _show_diff has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
    Open

    def _show_diff(diff, markdown=False, no_path=False, old=False):
        from collections import OrderedDict
    
        from dvc.utils.diff import table
    
    
    Severity: Minor
    Found in dvc/command/metrics.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 _checkout has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
    Open

    def _checkout(
        self,
        targets=None,
        with_deps=False,
        force=False,
    Severity: Minor
    Found in dvc/repo/checkout.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 parse_target has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
    Open

    def parse_target(target, default=None):
        from dvc.dvcfile import PIPELINE_FILE, PIPELINE_LOCK, is_valid_filename
        from dvc.exceptions import DvcException
    
        if not target:
    Severity: Minor
    Found in dvc/utils/__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 gc has 11 arguments (exceeds 4 allowed). Consider refactoring.
    Open

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

      Function pull has 11 arguments (exceeds 4 allowed). Consider refactoring.
      Open

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

        Function _fetch has 11 arguments (exceeds 4 allowed). Consider refactoring.
        Open

        def _fetch(
        Severity: Major
        Found in dvc/repo/fetch.py - About 1 hr to fix

          Function status has 10 arguments (exceeds 4 allowed). Consider refactoring.
          Open

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

            Function format has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
            Open

                def format(self, record):
                    record.message = record.getMessage()
                    msg = self.formatMessage(record)
            
                    if record.levelname == "INFO":
            Severity: Minor
            Found in dvc/logger.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 gdrive_delete_file has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
            Open

                def gdrive_delete_file(self, item_id):
                    from pydrive2.files import ApiRequestError
            
                    param = {"id": item_id}
                    # it does not create a file on the remote
            Severity: Minor
            Found in dvc/remote/gdrive.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 _checkout_dir has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
            Open

                def _checkout_dir(
                    self,
                    path_info,
                    checksum,
                    force,
            Severity: Minor
            Found in dvc/remote/base.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 push has 10 arguments (exceeds 4 allowed). Consider refactoring.
            Open

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

              Function used_cache has 10 arguments (exceeds 4 allowed). Consider refactoring.
              Open

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

                Function _create_stages has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                Open

                def _create_stages(repo, targets, fname, pbar=None, external=False):
                    from dvc.stage import Stage, create_stage
                
                    stages = []
                
                
                Severity: Minor
                Found in dvc/repo/add.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

                Severity
                Category
                Status
                Source
                Language