saltstack/salt

View on GitHub
salt/states/pkg.py

Summary

Maintainability
F
1 mo
Test Coverage

File pkg.py has 2699 lines of code (exceeds 250 allowed). Consider refactoring.
Open

# -*- coding: utf-8 -*-
'''
Installation of packages using OS package managers such as yum or apt-get
=========================================================================

Severity: Major
Found in salt/states/pkg.py - About 1 wk to fix

    Function installed has a Cognitive Complexity of 220 (exceeds 5 allowed). Consider refactoring.
    Open

    def installed(
            name,
            version=None,
            refresh=None,
            fromrepo=None,
    Severity: Minor
    Found in salt/states/pkg.py - About 4 days 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 _find_install_targets has a Cognitive Complexity of 168 (exceeds 5 allowed). Consider refactoring.
    Open

    def _find_install_targets(name=None,
                              version=None,
                              pkgs=None,
                              sources=None,
                              skip_suggestions=False,
    Severity: Minor
    Found in salt/states/pkg.py - About 3 days 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

    Cyclomatic complexity is too high in function installed. (158)
    Open

    def installed(
            name,
            version=None,
            refresh=None,
            fromrepo=None,
    Severity: Minor
    Found in salt/states/pkg.py by radon

    Cyclomatic Complexity

    Cyclomatic Complexity corresponds to the number of decisions a block of code contains plus 1. This number (also called McCabe number) is equal to the number of linearly independent paths through the code. This number can be used as a guide when testing conditional logic in blocks.

    Radon analyzes the AST tree of a Python program to compute Cyclomatic Complexity. Statements have the following effects on Cyclomatic Complexity:

    Construct Effect on CC Reasoning
    if +1 An if statement is a single decision.
    elif +1 The elif statement adds another decision.
    else +0 The else statement does not cause a new decision. The decision is at the if.
    for +1 There is a decision at the start of the loop.
    while +1 There is a decision at the while statement.
    except +1 Each except branch adds a new conditional path of execution.
    finally +0 The finally block is unconditionally executed.
    with +1 The with statement roughly corresponds to a try/except block (see PEP 343 for details).
    assert +1 The assert statement internally roughly equals a conditional statement.
    Comprehension +1 A list/set/dict comprehension of generator expression is equivalent to a for loop.
    Boolean Operator +1 Every boolean operator (and, or) adds a decision point.

    Source: http://radon.readthedocs.org/en/latest/intro.html

    Cyclomatic complexity is too high in function _find_install_targets. (106)
    Open

    def _find_install_targets(name=None,
                              version=None,
                              pkgs=None,
                              sources=None,
                              skip_suggestions=False,
    Severity: Minor
    Found in salt/states/pkg.py by radon

    Cyclomatic Complexity

    Cyclomatic Complexity corresponds to the number of decisions a block of code contains plus 1. This number (also called McCabe number) is equal to the number of linearly independent paths through the code. This number can be used as a guide when testing conditional logic in blocks.

    Radon analyzes the AST tree of a Python program to compute Cyclomatic Complexity. Statements have the following effects on Cyclomatic Complexity:

    Construct Effect on CC Reasoning
    if +1 An if statement is a single decision.
    elif +1 The elif statement adds another decision.
    else +0 The else statement does not cause a new decision. The decision is at the if.
    for +1 There is a decision at the start of the loop.
    while +1 There is a decision at the while statement.
    except +1 Each except branch adds a new conditional path of execution.
    finally +0 The finally block is unconditionally executed.
    with +1 The with statement roughly corresponds to a try/except block (see PEP 343 for details).
    assert +1 The assert statement internally roughly equals a conditional statement.
    Comprehension +1 A list/set/dict comprehension of generator expression is equivalent to a for loop.
    Boolean Operator +1 Every boolean operator (and, or) adds a decision point.

    Source: http://radon.readthedocs.org/en/latest/intro.html

    Function latest has a Cognitive Complexity of 81 (exceeds 5 allowed). Consider refactoring.
    Open

    def latest(
            name,
            refresh=None,
            fromrepo=None,
            skip_verify=False,
    Severity: Minor
    Found in salt/states/pkg.py - About 1 day 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 mod_aggregate has a Cognitive Complexity of 53 (exceeds 5 allowed). Consider refactoring.
    Open

    def mod_aggregate(low, chunks, running):
        '''
        The mod_aggregate function which looks up all packages in the available
        low chunks and merges them into a single pkgs ref in the present low data
        '''
    Severity: Minor
    Found in salt/states/pkg.py - About 1 day 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 _find_download_targets has a Cognitive Complexity of 42 (exceeds 5 allowed). Consider refactoring.
    Open

    def _find_download_targets(name=None,
                               version=None,
                               pkgs=None,
                               normalize=True,
                               skip_suggestions=False,
    Severity: Minor
    Found in salt/states/pkg.py - About 6 hrs 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

    Cyclomatic complexity is too high in function latest. (46)
    Open

    def latest(
            name,
            refresh=None,
            fromrepo=None,
            skip_verify=False,
    Severity: Minor
    Found in salt/states/pkg.py by radon

    Cyclomatic Complexity

    Cyclomatic Complexity corresponds to the number of decisions a block of code contains plus 1. This number (also called McCabe number) is equal to the number of linearly independent paths through the code. This number can be used as a guide when testing conditional logic in blocks.

    Radon analyzes the AST tree of a Python program to compute Cyclomatic Complexity. Statements have the following effects on Cyclomatic Complexity:

    Construct Effect on CC Reasoning
    if +1 An if statement is a single decision.
    elif +1 The elif statement adds another decision.
    else +0 The else statement does not cause a new decision. The decision is at the if.
    for +1 There is a decision at the start of the loop.
    while +1 There is a decision at the while statement.
    except +1 Each except branch adds a new conditional path of execution.
    finally +0 The finally block is unconditionally executed.
    with +1 The with statement roughly corresponds to a try/except block (see PEP 343 for details).
    assert +1 The assert statement internally roughly equals a conditional statement.
    Comprehension +1 A list/set/dict comprehension of generator expression is equivalent to a for loop.
    Boolean Operator +1 Every boolean operator (and, or) adds a decision point.

    Source: http://radon.readthedocs.org/en/latest/intro.html

    Function group_installed has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring.
    Open

    def group_installed(name, skip=None, include=None, **kwargs):
        '''
        .. versionadded:: 2015.8.0
    
        .. versionchanged:: 2016.11.0
    Severity: Minor
    Found in salt/states/pkg.py - About 4 hrs 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

    Cyclomatic complexity is too high in function _find_download_targets. (29)
    Open

    def _find_download_targets(name=None,
                               version=None,
                               pkgs=None,
                               normalize=True,
                               skip_suggestions=False,
    Severity: Minor
    Found in salt/states/pkg.py by radon

    Cyclomatic Complexity

    Cyclomatic Complexity corresponds to the number of decisions a block of code contains plus 1. This number (also called McCabe number) is equal to the number of linearly independent paths through the code. This number can be used as a guide when testing conditional logic in blocks.

    Radon analyzes the AST tree of a Python program to compute Cyclomatic Complexity. Statements have the following effects on Cyclomatic Complexity:

    Construct Effect on CC Reasoning
    if +1 An if statement is a single decision.
    elif +1 The elif statement adds another decision.
    else +0 The else statement does not cause a new decision. The decision is at the if.
    for +1 There is a decision at the start of the loop.
    while +1 There is a decision at the while statement.
    except +1 Each except branch adds a new conditional path of execution.
    finally +0 The finally block is unconditionally executed.
    with +1 The with statement roughly corresponds to a try/except block (see PEP 343 for details).
    assert +1 The assert statement internally roughly equals a conditional statement.
    Comprehension +1 A list/set/dict comprehension of generator expression is equivalent to a for loop.
    Boolean Operator +1 Every boolean operator (and, or) adds a decision point.

    Source: http://radon.readthedocs.org/en/latest/intro.html

    Function _uninstall has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
    Open

    def _uninstall(
        action='remove',
        name=None,
        version=None,
        pkgs=None,
    Severity: Minor
    Found in salt/states/pkg.py - About 3 hrs 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 _find_remove_targets has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
    Open

    def _find_remove_targets(name=None,
                             version=None,
                             pkgs=None,
                             normalize=True,
                             ignore_epoch=False,
    Severity: Minor
    Found in salt/states/pkg.py - About 3 hrs 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

    Cyclomatic complexity is too high in function group_installed. (27)
    Open

    def group_installed(name, skip=None, include=None, **kwargs):
        '''
        .. versionadded:: 2015.8.0
    
        .. versionchanged:: 2016.11.0
    Severity: Minor
    Found in salt/states/pkg.py by radon

    Cyclomatic Complexity

    Cyclomatic Complexity corresponds to the number of decisions a block of code contains plus 1. This number (also called McCabe number) is equal to the number of linearly independent paths through the code. This number can be used as a guide when testing conditional logic in blocks.

    Radon analyzes the AST tree of a Python program to compute Cyclomatic Complexity. Statements have the following effects on Cyclomatic Complexity:

    Construct Effect on CC Reasoning
    if +1 An if statement is a single decision.
    elif +1 The elif statement adds another decision.
    else +0 The else statement does not cause a new decision. The decision is at the if.
    for +1 There is a decision at the start of the loop.
    while +1 There is a decision at the while statement.
    except +1 Each except branch adds a new conditional path of execution.
    finally +0 The finally block is unconditionally executed.
    with +1 The with statement roughly corresponds to a try/except block (see PEP 343 for details).
    assert +1 The assert statement internally roughly equals a conditional statement.
    Comprehension +1 A list/set/dict comprehension of generator expression is equivalent to a for loop.
    Boolean Operator +1 Every boolean operator (and, or) adds a decision point.

    Source: http://radon.readthedocs.org/en/latest/intro.html

    Cyclomatic complexity is too high in function _uninstall. (26)
    Open

    def _uninstall(
        action='remove',
        name=None,
        version=None,
        pkgs=None,
    Severity: Minor
    Found in salt/states/pkg.py by radon

    Cyclomatic Complexity

    Cyclomatic Complexity corresponds to the number of decisions a block of code contains plus 1. This number (also called McCabe number) is equal to the number of linearly independent paths through the code. This number can be used as a guide when testing conditional logic in blocks.

    Radon analyzes the AST tree of a Python program to compute Cyclomatic Complexity. Statements have the following effects on Cyclomatic Complexity:

    Construct Effect on CC Reasoning
    if +1 An if statement is a single decision.
    elif +1 The elif statement adds another decision.
    else +0 The else statement does not cause a new decision. The decision is at the if.
    for +1 There is a decision at the start of the loop.
    while +1 There is a decision at the while statement.
    except +1 Each except branch adds a new conditional path of execution.
    finally +0 The finally block is unconditionally executed.
    with +1 The with statement roughly corresponds to a try/except block (see PEP 343 for details).
    assert +1 The assert statement internally roughly equals a conditional statement.
    Comprehension +1 A list/set/dict comprehension of generator expression is equivalent to a for loop.
    Boolean Operator +1 Every boolean operator (and, or) adds a decision point.

    Source: http://radon.readthedocs.org/en/latest/intro.html

    Function _verify_install has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
    Open

    def _verify_install(desired, new_pkgs, ignore_epoch=False, new_caps=None):
        '''
        Determine whether or not the installed packages match what was requested in
        the SLS file.
        '''
    Severity: Minor
    Found in salt/states/pkg.py - About 2 hrs 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 uptodate has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
    Open

    def uptodate(name, refresh=False, pkgs=None, **kwargs):
        '''
        .. versionadded:: 2014.7.0
        .. versionchanged:: 2018.3.0
    
    
    Severity: Minor
    Found in salt/states/pkg.py - About 2 hrs 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 downloaded has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
    Open

    def downloaded(name,
                   version=None,
                   pkgs=None,
                   fromrepo=None,
                   ignore_epoch=None,
    Severity: Minor
    Found in salt/states/pkg.py - About 2 hrs 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 patch_installed has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
    Open

    def patch_installed(name, advisory_ids=None, downloadonly=None, **kwargs):
        '''
        .. versionadded:: 2017.7.0
    
        Ensure that packages related to certain advisory ids are installed.
    Severity: Minor
    Found in salt/states/pkg.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 installed has 28 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    def installed(
            name,
            version=None,
            refresh=None,
            fromrepo=None,
    Severity: Minor
    Found in salt/states/pkg.py - About 1 hr to fix

      Consider simplifying this complex logical expression.
      Open

                  if version and version in cver \
                          and not reinstall \
                          and not pkg_verify:
                      # The package is installed and is the correct version
                      return {'name': name,
      Severity: Major
      Found in salt/states/pkg.py - About 1 hr to fix

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

        def _fulfills_version_string(installed_versions, version_conditions_string, ignore_epoch=False, allow_updates=False):
            '''
            Returns True if any of the installed versions match the specified version conditions,
            otherwise returns False.
        
        
        Severity: Minor
        Found in salt/states/pkg.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

        Avoid deeply nested control flow statements.
        Open

                            if 'pkgs' in chunk:
                                pkgs.extend(chunk['pkgs'])
                                chunk['__agg__'] = True
                            elif 'name' in chunk:
                                version = chunk.pop('version', None)
        Severity: Major
        Found in salt/states/pkg.py - About 45 mins to fix

          Function _preflight_check has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
          Open

          def _preflight_check(desired, fromrepo, **kwargs):
              '''
              Perform platform-specific checks on desired packages
              '''
              if 'pkg.check_db' not in __salt__:
          Severity: Minor
          Found in salt/states/pkg.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

          Avoid deeply nested control flow statements.
          Open

                              if sources:
                                  reinstall_targets.append(reinstall_pkg)
                              else:
                                  reinstall_targets.append(
                                      _get_desired_pkg(reinstall_pkg, to_reinstall)
          Severity: Major
          Found in salt/states/pkg.py - About 45 mins to fix

            Avoid deeply nested control flow statements.
            Open

                                if verify_result:
                                    to_reinstall[package_name] = version_string
                                    altered_files[package_name] = verify_result
                            else:
            Severity: Major
            Found in salt/states/pkg.py - About 45 mins to fix

              Avoid deeply nested control flow statements.
              Open

                                  if sources:
                                      pkgstr = reinstall_pkg
                                  else:
                                      pkgstr = _get_desired_pkg(reinstall_pkg, to_reinstall)
                                  comment.append(
              Severity: Major
              Found in salt/states/pkg.py - About 45 mins to fix

                Function _fulfills_version_spec has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                Open

                def _fulfills_version_spec(versions, oper, desired_version,
                                           ignore_epoch=False):
                    '''
                    Returns True if any of the installed versions match the specified version,
                    otherwise returns False
                Severity: Minor
                Found in salt/states/pkg.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 _find_advisory_targets has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                Open

                def _find_advisory_targets(name=None,
                                           advisory_ids=None,
                                           **kwargs):
                    '''
                    Inspect the arguments to pkg.patch_installed and discover what advisory
                Severity: Minor
                Found in salt/states/pkg.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

                Avoid deeply nested control flow statements.
                Open

                                    if verify_result:
                                        to_reinstall[package_name] = version_string
                                        altered_files[package_name] = verify_result
                                continue
                Severity: Major
                Found in salt/states/pkg.py - About 45 mins to fix

                  Avoid deeply nested control flow statements.
                  Open

                                          for pkgname, suggestions in \
                                                  six.iteritems(problems['suggest']):
                                              comments.append(
                                                  'Package \'{0}\' not found (possible matches: '
                                                  '{1})'.format(pkgname, ', '.join(suggestions))
                  Severity: Major
                  Found in salt/states/pkg.py - About 45 mins to fix

                    Avoid deeply nested control flow statements.
                    Open

                                            if len(comments) > 1:
                                                comments.append('')
                                            return {'name': name,
                    Severity: Major
                    Found in salt/states/pkg.py - About 45 mins to fix

                      Avoid too many return statements within this function.
                      Open

                                      return ret
                      Severity: Major
                      Found in salt/states/pkg.py - About 30 mins to fix

                        Avoid too many return statements within this function.
                        Open

                            return ret
                        Severity: Major
                        Found in salt/states/pkg.py - About 30 mins to fix

                          Avoid too many return statements within this function.
                          Open

                                  return ret
                          Severity: Major
                          Found in salt/states/pkg.py - About 30 mins to fix

                            Avoid too many return statements within this function.
                            Open

                                        return {'name': name,
                            Severity: Major
                            Found in salt/states/pkg.py - About 30 mins to fix

                              Avoid too many return statements within this function.
                              Open

                                      return ret
                              Severity: Major
                              Found in salt/states/pkg.py - About 30 mins to fix

                                Avoid too many return statements within this function.
                                Open

                                        return {'name': name,
                                Severity: Major
                                Found in salt/states/pkg.py - About 30 mins to fix

                                  Avoid too many return statements within this function.
                                  Open

                                          return ret
                                  Severity: Major
                                  Found in salt/states/pkg.py - About 30 mins to fix

                                    Avoid too many return statements within this function.
                                    Open

                                        return targets
                                    Severity: Major
                                    Found in salt/states/pkg.py - About 30 mins to fix

                                      Avoid too many return statements within this function.
                                      Open

                                              return ret
                                      Severity: Major
                                      Found in salt/states/pkg.py - About 30 mins to fix

                                        Avoid too many return statements within this function.
                                        Open

                                                        return {'name': name,
                                        Severity: Major
                                        Found in salt/states/pkg.py - About 30 mins to fix

                                          Avoid too many return statements within this function.
                                          Open

                                                  return ret
                                          Severity: Major
                                          Found in salt/states/pkg.py - About 30 mins to fix

                                            Avoid too many return statements within this function.
                                            Open

                                                    return ret
                                            Severity: Major
                                            Found in salt/states/pkg.py - About 30 mins to fix

                                              Avoid too many return statements within this function.
                                              Open

                                                      return {'name': name,
                                              Severity: Major
                                              Found in salt/states/pkg.py - About 30 mins to fix

                                                Avoid too many return statements within this function.
                                                Open

                                                        return {'name': name,
                                                Severity: Major
                                                Found in salt/states/pkg.py - About 30 mins to fix

                                                  Avoid too many return statements within this function.
                                                  Open

                                                              return ret
                                                  Severity: Major
                                                  Found in salt/states/pkg.py - About 30 mins to fix

                                                    Avoid too many return statements within this function.
                                                    Open

                                                                return {'name': name,
                                                    Severity: Major
                                                    Found in salt/states/pkg.py - About 30 mins to fix

                                                      Avoid too many return statements within this function.
                                                      Open

                                                                      return {'name': name,
                                                      Severity: Major
                                                      Found in salt/states/pkg.py - About 30 mins to fix

                                                        Avoid too many return statements within this function.
                                                        Open

                                                                return ret
                                                        Severity: Major
                                                        Found in salt/states/pkg.py - About 30 mins to fix

                                                          Avoid too many return statements within this function.
                                                          Open

                                                              return ret
                                                          Severity: Major
                                                          Found in salt/states/pkg.py - About 30 mins to fix

                                                            Avoid too many return statements within this function.
                                                            Open

                                                                    return ret
                                                            Severity: Major
                                                            Found in salt/states/pkg.py - About 30 mins to fix

                                                              Avoid too many return statements within this function.
                                                              Open

                                                                      return {'name': name,
                                                              Severity: Major
                                                              Found in salt/states/pkg.py - About 30 mins to fix

                                                                Avoid too many return statements within this function.
                                                                Open

                                                                    return ret
                                                                Severity: Major
                                                                Found in salt/states/pkg.py - About 30 mins to fix

                                                                  Avoid too many return statements within this function.
                                                                  Open

                                                                          return ret
                                                                  Severity: Major
                                                                  Found in salt/states/pkg.py - About 30 mins to fix

                                                                    Avoid too many return statements within this function.
                                                                    Open

                                                                        return ret
                                                                    Severity: Major
                                                                    Found in salt/states/pkg.py - About 30 mins to fix

                                                                      Avoid too many return statements within this function.
                                                                      Open

                                                                              return {'name': name,
                                                                      Severity: Major
                                                                      Found in salt/states/pkg.py - About 30 mins to fix

                                                                        Avoid too many return statements within this function.
                                                                        Open

                                                                                return result
                                                                        Severity: Major
                                                                        Found in salt/states/pkg.py - About 30 mins to fix

                                                                          Avoid too many return statements within this function.
                                                                          Open

                                                                                  return {'name': name,
                                                                          Severity: Major
                                                                          Found in salt/states/pkg.py - About 30 mins to fix

                                                                            Avoid too many return statements within this function.
                                                                            Open

                                                                                    return {
                                                                            Severity: Major
                                                                            Found in salt/states/pkg.py - About 30 mins to fix

                                                                              Avoid too many return statements within this function.
                                                                              Open

                                                                                      return ret
                                                                              Severity: Major
                                                                              Found in salt/states/pkg.py - About 30 mins to fix

                                                                                Avoid too many return statements within this function.
                                                                                Open

                                                                                            return {'name': name,
                                                                                Severity: Major
                                                                                Found in salt/states/pkg.py - About 30 mins to fix

                                                                                  Avoid too many return statements within this function.
                                                                                  Open

                                                                                          return ret
                                                                                  Severity: Major
                                                                                  Found in salt/states/pkg.py - About 30 mins to fix

                                                                                    Avoid too many return statements within this function.
                                                                                    Open

                                                                                            return ret
                                                                                    Severity: Major
                                                                                    Found in salt/states/pkg.py - About 30 mins to fix

                                                                                      Avoid too many return statements within this function.
                                                                                      Open

                                                                                              return ret
                                                                                      Severity: Major
                                                                                      Found in salt/states/pkg.py - About 30 mins to fix

                                                                                        Avoid too many return statements within this function.
                                                                                        Open

                                                                                                        return {'name': name,
                                                                                        Severity: Major
                                                                                        Found in salt/states/pkg.py - About 30 mins to fix

                                                                                          Avoid too many return statements within this function.
                                                                                          Open

                                                                                                  return {'name': name,
                                                                                          Severity: Major
                                                                                          Found in salt/states/pkg.py - About 30 mins to fix

                                                                                            Avoid too many return statements within this function.
                                                                                            Open

                                                                                                    return ret
                                                                                            Severity: Major
                                                                                            Found in salt/states/pkg.py - About 30 mins to fix

                                                                                              Avoid too many return statements within this function.
                                                                                              Open

                                                                                                  return ret
                                                                                              Severity: Major
                                                                                              Found in salt/states/pkg.py - About 30 mins to fix

                                                                                                Avoid too many return statements within this function.
                                                                                                Open

                                                                                                                return {'name': name,
                                                                                                Severity: Major
                                                                                                Found in salt/states/pkg.py - About 30 mins to fix

                                                                                                  Avoid too many return statements within this function.
                                                                                                  Open

                                                                                                          return ret
                                                                                                  Severity: Major
                                                                                                  Found in salt/states/pkg.py - About 30 mins to fix

                                                                                                    Avoid too many return statements within this function.
                                                                                                    Open

                                                                                                                return ret
                                                                                                    Severity: Major
                                                                                                    Found in salt/states/pkg.py - About 30 mins to fix

                                                                                                      Avoid too many return statements within this function.
                                                                                                      Open

                                                                                                              return {'name': name,
                                                                                                      Severity: Major
                                                                                                      Found in salt/states/pkg.py - About 30 mins to fix

                                                                                                        Avoid too many return statements within this function.
                                                                                                        Open

                                                                                                                                return {'name': name,
                                                                                                        Severity: Major
                                                                                                        Found in salt/states/pkg.py - About 30 mins to fix

                                                                                                          Avoid too many return statements within this function.
                                                                                                          Open

                                                                                                              return (desired, targets, to_unpurge, to_reinstall, altered_files,
                                                                                                          Severity: Major
                                                                                                          Found in salt/states/pkg.py - About 30 mins to fix

                                                                                                            Avoid too many return statements within this function.
                                                                                                            Open

                                                                                                                        return {'name': name,
                                                                                                            Severity: Major
                                                                                                            Found in salt/states/pkg.py - About 30 mins to fix

                                                                                                              Avoid too many return statements within this function.
                                                                                                              Open

                                                                                                                  return {'name': name,
                                                                                                              Severity: Major
                                                                                                              Found in salt/states/pkg.py - About 30 mins to fix

                                                                                                                Similar blocks of code found in 2 locations. Consider refactoring.
                                                                                                                Open

                                                                                                                    if not skip_suggestions:
                                                                                                                        try:
                                                                                                                            problems = _preflight_check(to_download, **kwargs)
                                                                                                                        except CommandExecutionError:
                                                                                                                            pass
                                                                                                                Severity: Major
                                                                                                                Found in salt/states/pkg.py and 1 other location - About 1 day to fix
                                                                                                                salt/states/pkg.py on lines 650..678

                                                                                                                Duplicated Code

                                                                                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                                Tuning

                                                                                                                This issue has a mass of 169.

                                                                                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                                Refactorings

                                                                                                                Further Reading

                                                                                                                Similar blocks of code found in 2 locations. Consider refactoring.
                                                                                                                Open

                                                                                                                            if not_installed:
                                                                                                                                try:
                                                                                                                                    problems = _preflight_check(not_installed, **kwargs)
                                                                                                                                except CommandExecutionError:
                                                                                                                                    pass
                                                                                                                Severity: Major
                                                                                                                Found in salt/states/pkg.py and 1 other location - About 1 day to fix
                                                                                                                salt/states/pkg.py on lines 303..331

                                                                                                                Duplicated Code

                                                                                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                                Tuning

                                                                                                                This issue has a mass of 169.

                                                                                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                                Refactorings

                                                                                                                Further Reading

                                                                                                                Similar blocks of code found in 2 locations. Consider refactoring.
                                                                                                                Open

                                                                                                                def removed(name,
                                                                                                                            version=None,
                                                                                                                            pkgs=None,
                                                                                                                            normalize=True,
                                                                                                                            ignore_epoch=False,
                                                                                                                Severity: Major
                                                                                                                Found in salt/states/pkg.py and 1 other location - About 1 day to fix
                                                                                                                salt/states/pkg.py on lines 2876..2979

                                                                                                                Duplicated Code

                                                                                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                                Tuning

                                                                                                                This issue has a mass of 146.

                                                                                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                                Refactorings

                                                                                                                Further Reading

                                                                                                                Similar blocks of code found in 2 locations. Consider refactoring.
                                                                                                                Open

                                                                                                                def purged(name,
                                                                                                                           version=None,
                                                                                                                           pkgs=None,
                                                                                                                           normalize=True,
                                                                                                                           ignore_epoch=False,
                                                                                                                Severity: Major
                                                                                                                Found in salt/states/pkg.py and 1 other location - About 1 day to fix
                                                                                                                salt/states/pkg.py on lines 2770..2873

                                                                                                                Duplicated Code

                                                                                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                                Tuning

                                                                                                                This issue has a mass of 146.

                                                                                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                                Refactorings

                                                                                                                Further Reading

                                                                                                                Identical blocks of code found in 2 locations. Consider refactoring.
                                                                                                                Open

                                                                                                                                if pkg_type == 'pkgs':
                                                                                                                                    # Pull out the pkg names!
                                                                                                                                    if 'pkgs' in chunk:
                                                                                                                                        pkgs.extend(chunk['pkgs'])
                                                                                                                                        chunk['__agg__'] = True
                                                                                                                Severity: Major
                                                                                                                Found in salt/states/pkg.py and 1 other location - About 1 day to fix
                                                                                                                salt/states/pip_state.py on lines 1132..1143

                                                                                                                Duplicated Code

                                                                                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                                Tuning

                                                                                                                This issue has a mass of 125.

                                                                                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                                Refactorings

                                                                                                                Further Reading

                                                                                                                Similar blocks of code found in 4 locations. Consider refactoring.
                                                                                                                Open

                                                                                                                    if isinstance(pkg_verify, list) \
                                                                                                                            and any(x.get('verify_options') is not None
                                                                                                                                    for x in pkg_verify
                                                                                                                                    if isinstance(x, _OrderedDict)
                                                                                                                                    and 'verify_options' in x):
                                                                                                                Severity: Major
                                                                                                                Found in salt/states/pkg.py and 3 other locations - About 4 hrs to fix
                                                                                                                salt/states/pkg.py on lines 522..531
                                                                                                                salt/states/pkg.py on lines 534..543
                                                                                                                salt/states/pkg.py on lines 1940..1949

                                                                                                                Duplicated Code

                                                                                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                                Tuning

                                                                                                                This issue has a mass of 93.

                                                                                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                                Refactorings

                                                                                                                Further Reading

                                                                                                                Similar blocks of code found in 4 locations. Consider refactoring.
                                                                                                                Open

                                                                                                                    if isinstance(pkg_verify, list) \
                                                                                                                            and any(x.get('ignore_types') is not None
                                                                                                                                    for x in pkg_verify
                                                                                                                                    if isinstance(x, _OrderedDict)
                                                                                                                                    and 'ignore_types' in x):
                                                                                                                Severity: Major
                                                                                                                Found in salt/states/pkg.py and 3 other locations - About 4 hrs to fix
                                                                                                                salt/states/pkg.py on lines 522..531
                                                                                                                salt/states/pkg.py on lines 534..543
                                                                                                                salt/states/pkg.py on lines 1952..1961

                                                                                                                Duplicated Code

                                                                                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                                Tuning

                                                                                                                This issue has a mass of 93.

                                                                                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                                Refactorings

                                                                                                                Further Reading

                                                                                                                Similar blocks of code found in 4 locations. Consider refactoring.
                                                                                                                Open

                                                                                                                    if isinstance(pkg_verify, list) \
                                                                                                                            and any(x.get('verify_options') is not None
                                                                                                                                    for x in pkg_verify
                                                                                                                                    if isinstance(x, _OrderedDict)
                                                                                                                                    and 'verify_options' in x):
                                                                                                                Severity: Major
                                                                                                                Found in salt/states/pkg.py and 3 other locations - About 4 hrs to fix
                                                                                                                salt/states/pkg.py on lines 522..531
                                                                                                                salt/states/pkg.py on lines 1940..1949
                                                                                                                salt/states/pkg.py on lines 1952..1961

                                                                                                                Duplicated Code

                                                                                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                                Tuning

                                                                                                                This issue has a mass of 93.

                                                                                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                                Refactorings

                                                                                                                Further Reading

                                                                                                                Similar blocks of code found in 4 locations. Consider refactoring.
                                                                                                                Open

                                                                                                                    if isinstance(pkg_verify, list) \
                                                                                                                            and any(x.get('ignore_types') is not None
                                                                                                                                    for x in pkg_verify
                                                                                                                                    if isinstance(x, _OrderedDict)
                                                                                                                                    and 'ignore_types' in x):
                                                                                                                Severity: Major
                                                                                                                Found in salt/states/pkg.py and 3 other locations - About 4 hrs to fix
                                                                                                                salt/states/pkg.py on lines 534..543
                                                                                                                salt/states/pkg.py on lines 1940..1949
                                                                                                                salt/states/pkg.py on lines 1952..1961

                                                                                                                Duplicated Code

                                                                                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                                Tuning

                                                                                                                This issue has a mass of 93.

                                                                                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                                Refactorings

                                                                                                                Further Reading

                                                                                                                Similar blocks of code found in 2 locations. Consider refactoring.
                                                                                                                Open

                                                                                                                    if modified:
                                                                                                                        # Add a comment for each package in modified with its pkg.verify output
                                                                                                                        for modified_pkg in modified:
                                                                                                                            if sources:
                                                                                                                                pkgstr = modified_pkg
                                                                                                                Severity: Major
                                                                                                                Found in salt/states/pkg.py and 1 other location - About 4 hrs to fix
                                                                                                                salt/states/pkg.py on lines 2002..2014

                                                                                                                Duplicated Code

                                                                                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                                Tuning

                                                                                                                This issue has a mass of 92.

                                                                                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                                Refactorings

                                                                                                                Further Reading

                                                                                                                Similar blocks of code found in 2 locations. Consider refactoring.
                                                                                                                Open

                                                                                                                        for failed_pkg in failed:
                                                                                                                            if sources:
                                                                                                                                pkgstr = failed_pkg
                                                                                                                            else:
                                                                                                                                pkgstr = _get_desired_pkg(failed_pkg, desired)
                                                                                                                Severity: Major
                                                                                                                Found in salt/states/pkg.py and 1 other location - About 4 hrs to fix
                                                                                                                salt/states/pkg.py on lines 1985..1998

                                                                                                                Duplicated Code

                                                                                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                                Tuning

                                                                                                                This issue has a mass of 92.

                                                                                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                                Refactorings

                                                                                                                Further Reading

                                                                                                                Similar blocks of code found in 2 locations. Consider refactoring.
                                                                                                                Open

                                                                                                                    if include is None:
                                                                                                                        include = []
                                                                                                                    else:
                                                                                                                        if not isinstance(include, list):
                                                                                                                            ret['comment'] = 'include must be formatted as a list'
                                                                                                                Severity: Major
                                                                                                                Found in salt/states/pkg.py and 1 other location - About 4 hrs to fix
                                                                                                                salt/states/pkg.py on lines 3146..3154

                                                                                                                Duplicated Code

                                                                                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                                Tuning

                                                                                                                This issue has a mass of 88.

                                                                                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                                Refactorings

                                                                                                                Further Reading

                                                                                                                Similar blocks of code found in 2 locations. Consider refactoring.
                                                                                                                Open

                                                                                                                    if skip is None:
                                                                                                                        skip = []
                                                                                                                    else:
                                                                                                                        if not isinstance(skip, list):
                                                                                                                            ret['comment'] = 'skip must be formatted as a list'
                                                                                                                Severity: Major
                                                                                                                Found in salt/states/pkg.py and 1 other location - About 4 hrs to fix
                                                                                                                salt/states/pkg.py on lines 3156..3164

                                                                                                                Duplicated Code

                                                                                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                                Tuning

                                                                                                                This issue has a mass of 88.

                                                                                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                                Refactorings

                                                                                                                Further Reading

                                                                                                                Identical blocks of code found in 2 locations. Consider refactoring.
                                                                                                                Open

                                                                                                                                if (not reinstall) and pkg_verify:
                                                                                                                                    try:
                                                                                                                                        verify_result = __salt__['pkg.verify'](
                                                                                                                                            package_name,
                                                                                                                                            ignore_types=ignore_types,
                                                                                                                Severity: Major
                                                                                                                Found in salt/states/pkg.py and 1 other location - About 3 hrs to fix
                                                                                                                salt/states/pkg.py on lines 790..803

                                                                                                                Duplicated Code

                                                                                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                                Tuning

                                                                                                                This issue has a mass of 71.

                                                                                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                                Refactorings

                                                                                                                Further Reading

                                                                                                                Identical blocks of code found in 2 locations. Consider refactoring.
                                                                                                                Open

                                                                                                                                if pkg_verify and any(oper == '==' for oper, version in version_conditions):
                                                                                                                                    try:
                                                                                                                                        verify_result = __salt__['pkg.verify'](
                                                                                                                                            package_name,
                                                                                                                                            ignore_types=ignore_types,
                                                                                                                Severity: Major
                                                                                                                Found in salt/states/pkg.py and 1 other location - About 3 hrs to fix
                                                                                                                salt/states/pkg.py on lines 760..773

                                                                                                                Duplicated Code

                                                                                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                                Tuning

                                                                                                                This issue has a mass of 71.

                                                                                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                                Refactorings

                                                                                                                Further Reading

                                                                                                                Similar blocks of code found in 2 locations. Consider refactoring.
                                                                                                                Open

                                                                                                                        if __grains__['os'] == 'FreeBSD' and origin:
                                                                                                                            cver = [k for k, v in six.iteritems(cur_pkgs) if v['origin'] == pkgname]
                                                                                                                        else:
                                                                                                                            cver = cur_pkgs.get(pkgname, [])
                                                                                                                Severity: Major
                                                                                                                Found in salt/states/pkg.py and 1 other location - About 3 hrs to fix
                                                                                                                salt/states/pkg.py on lines 611..615

                                                                                                                Duplicated Code

                                                                                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                                Tuning

                                                                                                                This issue has a mass of 70.

                                                                                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                                Refactorings

                                                                                                                Further Reading

                                                                                                                Similar blocks of code found in 2 locations. Consider refactoring.
                                                                                                                Open

                                                                                                                        if __grains__['os'] == 'FreeBSD' and origin:
                                                                                                                            cver = [k for k, v in six.iteritems(cur_pkgs)
                                                                                                                                    if v['origin'] == name]
                                                                                                                        else:
                                                                                                                            cver = cur_pkgs.get(name, [])
                                                                                                                Severity: Major
                                                                                                                Found in salt/states/pkg.py and 1 other location - About 3 hrs to fix
                                                                                                                salt/states/pkg.py on lines 452..455

                                                                                                                Duplicated Code

                                                                                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                                Tuning

                                                                                                                This issue has a mass of 70.

                                                                                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                                Refactorings

                                                                                                                Further Reading

                                                                                                                Similar blocks of code found in 2 locations. Consider refactoring.
                                                                                                                Open

                                                                                                                    if isinstance(targets, dict) and 'result' in targets:
                                                                                                                        return targets
                                                                                                                    elif not isinstance(targets, dict):
                                                                                                                        ret['result'] = False
                                                                                                                        ret['comment'] = 'An error was encountered while checking targets: ' \
                                                                                                                Severity: Major
                                                                                                                Found in salt/states/pkg.py and 1 other location - About 2 hrs to fix
                                                                                                                salt/states/pkg.py on lines 2222..2228

                                                                                                                Duplicated Code

                                                                                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                                Tuning

                                                                                                                This issue has a mass of 68.

                                                                                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                                Refactorings

                                                                                                                Further Reading

                                                                                                                Similar blocks of code found in 2 locations. Consider refactoring.
                                                                                                                Open

                                                                                                                    if isinstance(targets, dict) and 'result' in targets:
                                                                                                                        return targets
                                                                                                                    elif not isinstance(targets, list):
                                                                                                                        ret['result'] = False
                                                                                                                        ret['comment'] = 'An error was encountered while checking targets: ' \
                                                                                                                Severity: Major
                                                                                                                Found in salt/states/pkg.py and 1 other location - About 2 hrs to fix
                                                                                                                salt/states/pkg.py on lines 2130..2136

                                                                                                                Duplicated Code

                                                                                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                                Tuning

                                                                                                                This issue has a mass of 68.

                                                                                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                                Refactorings

                                                                                                                Further Reading

                                                                                                                Identical blocks of code found in 2 locations. Consider refactoring.
                                                                                                                Open

                                                                                                                                not_modified_hold = [hold_ret[x] for x in hold_ret
                                                                                                                                                     if not hold_ret[x]['changes']
                                                                                                                                                     and hold_ret[x]['result']]
                                                                                                                Severity: Major
                                                                                                                Found in salt/states/pkg.py and 1 other location - About 2 hrs to fix
                                                                                                                salt/states/pkg.py on lines 1827..1829

                                                                                                                Duplicated Code

                                                                                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                                Tuning

                                                                                                                This issue has a mass of 54.

                                                                                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                                Refactorings

                                                                                                                Further Reading

                                                                                                                Identical blocks of code found in 2 locations. Consider refactoring.
                                                                                                                Open

                                                                                                                                not_modified_hold = [hold_ret[x] for x in hold_ret
                                                                                                                                                     if not hold_ret[x]['changes']
                                                                                                                                                     and hold_ret[x]['result']]
                                                                                                                Severity: Major
                                                                                                                Found in salt/states/pkg.py and 1 other location - About 2 hrs to fix
                                                                                                                salt/states/pkg.py on lines 1660..1662

                                                                                                                Duplicated Code

                                                                                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                                Tuning

                                                                                                                This issue has a mass of 54.

                                                                                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                                Refactorings

                                                                                                                Further Reading

                                                                                                                Identical blocks of code found in 2 locations. Consider refactoring.
                                                                                                                Open

                                                                                                                    if pkg_type is not None and pkgs:
                                                                                                                        if pkg_type in low:
                                                                                                                            low[pkg_type].extend(pkgs)
                                                                                                                        else:
                                                                                                                            low[pkg_type] = pkgs
                                                                                                                Severity: Major
                                                                                                                Found in salt/states/pkg.py and 1 other location - About 2 hrs to fix
                                                                                                                salt/states/pip_state.py on lines 1144..1148

                                                                                                                Duplicated Code

                                                                                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                                Tuning

                                                                                                                This issue has a mass of 52.

                                                                                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                                Refactorings

                                                                                                                Further Reading

                                                                                                                Similar blocks of code found in 2 locations. Consider refactoring.
                                                                                                                Open

                                                                                                                    if action == 'purge':
                                                                                                                        old_removed = __salt__['pkg.list_pkgs'](versions_as_list=True,
                                                                                                                                                                removed=True,
                                                                                                                                                                **kwargs)
                                                                                                                        targets.extend([x for x in pkg_params if x in old_removed])
                                                                                                                Severity: Major
                                                                                                                Found in salt/states/pkg.py and 1 other location - About 1 hr to fix
                                                                                                                salt/states/pkg.py on lines 2740..2744

                                                                                                                Duplicated Code

                                                                                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                                Tuning

                                                                                                                This issue has a mass of 57.

                                                                                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                                Refactorings

                                                                                                                Further Reading

                                                                                                                Similar blocks of code found in 2 locations. Consider refactoring.
                                                                                                                Open

                                                                                                                    if action == 'purge':
                                                                                                                        new_removed = __salt__['pkg.list_pkgs'](versions_as_list=True,
                                                                                                                                                                removed=True,
                                                                                                                                                                **kwargs)
                                                                                                                        failed.extend([x for x in pkg_params if x in new_removed])
                                                                                                                Severity: Major
                                                                                                                Found in salt/states/pkg.py and 1 other location - About 1 hr to fix
                                                                                                                salt/states/pkg.py on lines 2705..2709

                                                                                                                Duplicated Code

                                                                                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                                Tuning

                                                                                                                This issue has a mass of 57.

                                                                                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                                Refactorings

                                                                                                                Further Reading

                                                                                                                Similar blocks of code found in 2 locations. Consider refactoring.
                                                                                                                Open

                                                                                                                        if len(not_modified) <= 20:
                                                                                                                            comment.append('The following packages were already installed: '
                                                                                                                                           '{0}'.format(summary))
                                                                                                                        else:
                                                                                                                            comment.append(
                                                                                                                Severity: Major
                                                                                                                Found in salt/states/pkg.py and 1 other location - About 1 hr to fix
                                                                                                                salt/states/pkg.py on lines 1871..1879

                                                                                                                Duplicated Code

                                                                                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                                Tuning

                                                                                                                This issue has a mass of 53.

                                                                                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                                Refactorings

                                                                                                                Further Reading

                                                                                                                Similar blocks of code found in 2 locations. Consider refactoring.
                                                                                                                Open

                                                                                                                        if len(summary) < 20:
                                                                                                                            comment.append('The following packages were installed/updated: '
                                                                                                                                           '{0}'.format(summary))
                                                                                                                        else:
                                                                                                                            comment.append(
                                                                                                                Severity: Major
                                                                                                                Found in salt/states/pkg.py and 1 other location - About 1 hr to fix
                                                                                                                salt/states/pkg.py on lines 1906..1914

                                                                                                                Duplicated Code

                                                                                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                                Tuning

                                                                                                                This issue has a mass of 53.

                                                                                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                                Refactorings

                                                                                                                Further Reading

                                                                                                                Similar blocks of code found in 2 locations. Consider refactoring.
                                                                                                                Open

                                                                                                                                for i in failed_hold:
                                                                                                                                    result['comment'] += '.\n{0}'.format(i['comment'])
                                                                                                                                    result['result'] = i['result']
                                                                                                                Severity: Major
                                                                                                                Found in salt/states/pkg.py and 1 other location - About 1 hr to fix
                                                                                                                salt/states/pkg.py on lines 1671..1673

                                                                                                                Duplicated Code

                                                                                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                                Tuning

                                                                                                                This issue has a mass of 48.

                                                                                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                                Refactorings

                                                                                                                Further Reading

                                                                                                                Similar blocks of code found in 2 locations. Consider refactoring.
                                                                                                                Open

                                                                                                                                for i in not_modified_hold:
                                                                                                                                    result['comment'] += '.\n{0}'.format(i['comment'])
                                                                                                                                    result['result'] = i['result']
                                                                                                                Severity: Major
                                                                                                                Found in salt/states/pkg.py and 1 other location - About 1 hr to fix
                                                                                                                salt/states/pkg.py on lines 1675..1677

                                                                                                                Duplicated Code

                                                                                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                                Tuning

                                                                                                                This issue has a mass of 48.

                                                                                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                                Refactorings

                                                                                                                Further Reading

                                                                                                                Similar blocks of code found in 2 locations. Consider refactoring.
                                                                                                                Open

                                                                                                                        if normalize:
                                                                                                                            _normalize_name = \
                                                                                                                                __salt__.get('pkg.normalize_name', lambda pkgname: pkgname)
                                                                                                                            desired = {_normalize_name(name): version}
                                                                                                                        else:
                                                                                                                Severity: Minor
                                                                                                                Found in salt/states/pkg.py and 1 other location - About 55 mins to fix
                                                                                                                salt/states/pkg.py on lines 276..281

                                                                                                                Duplicated Code

                                                                                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                                Tuning

                                                                                                                This issue has a mass of 45.

                                                                                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                                Refactorings

                                                                                                                Further Reading

                                                                                                                Similar blocks of code found in 2 locations. Consider refactoring.
                                                                                                                Open

                                                                                                                        if normalize:
                                                                                                                            _normalize_name = \
                                                                                                                                __salt__.get('pkg.normalize_name', lambda pkgname: pkgname)
                                                                                                                            to_download = {_normalize_name(name): version}
                                                                                                                        else:
                                                                                                                Severity: Minor
                                                                                                                Found in salt/states/pkg.py and 1 other location - About 55 mins to fix
                                                                                                                salt/states/pkg.py on lines 599..604

                                                                                                                Duplicated Code

                                                                                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                                Tuning

                                                                                                                This issue has a mass of 45.

                                                                                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                                Refactorings

                                                                                                                Further Reading

                                                                                                                Similar blocks of code found in 2 locations. Consider refactoring.
                                                                                                                Open

                                                                                                                    if not pkgs and isinstance(pkgs, list):
                                                                                                                        ret['result'] = True
                                                                                                                        ret['comment'] = 'No packages to download provided'
                                                                                                                        return ret
                                                                                                                Severity: Minor
                                                                                                                Found in salt/states/pkg.py and 1 other location - About 45 mins to fix
                                                                                                                salt/states/pkg.py on lines 2215..2218

                                                                                                                Duplicated Code

                                                                                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                                Tuning

                                                                                                                This issue has a mass of 43.

                                                                                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                                Refactorings

                                                                                                                Further Reading

                                                                                                                Similar blocks of code found in 2 locations. Consider refactoring.
                                                                                                                Open

                                                                                                                    if not advisory_ids and isinstance(advisory_ids, list):
                                                                                                                        ret['result'] = True
                                                                                                                        ret['comment'] = 'No advisory ids provided'
                                                                                                                        return ret
                                                                                                                Severity: Minor
                                                                                                                Found in salt/states/pkg.py and 1 other location - About 45 mins to fix
                                                                                                                salt/states/pkg.py on lines 2102..2105

                                                                                                                Duplicated Code

                                                                                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                                Tuning

                                                                                                                This issue has a mass of 43.

                                                                                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                                Refactorings

                                                                                                                Further Reading

                                                                                                                Similar blocks of code found in 2 locations. Consider refactoring.
                                                                                                                Open

                                                                                                                    if __opts__['test']:
                                                                                                                        summary = ', '.join(targets)
                                                                                                                        ret['comment'] = 'The following packages would be ' \
                                                                                                                                         'downloaded: {0}'.format(summary)
                                                                                                                        return ret
                                                                                                                Severity: Minor
                                                                                                                Found in salt/states/pkg.py and 1 other location - About 35 mins to fix
                                                                                                                salt/states/pkg.py on lines 2230..2234

                                                                                                                Duplicated Code

                                                                                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                                Tuning

                                                                                                                This issue has a mass of 41.

                                                                                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                                Refactorings

                                                                                                                Further Reading

                                                                                                                Similar blocks of code found in 2 locations. Consider refactoring.
                                                                                                                Open

                                                                                                                    if __opts__['test']:
                                                                                                                        summary = ', '.join(targets)
                                                                                                                        ret['comment'] = 'The following advisory patches would be ' \
                                                                                                                                         'downloaded: {0}'.format(summary)
                                                                                                                        return ret
                                                                                                                Severity: Minor
                                                                                                                Found in salt/states/pkg.py and 1 other location - About 35 mins to fix
                                                                                                                salt/states/pkg.py on lines 2138..2142

                                                                                                                Duplicated Code

                                                                                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                                Tuning

                                                                                                                This issue has a mass of 41.

                                                                                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                                Refactorings

                                                                                                                Further Reading

                                                                                                                Similar blocks of code found in 4 locations. Consider refactoring.
                                                                                                                Open

                                                                                                                        if sources:
                                                                                                                            summary = ', '.join(failed)
                                                                                                                        else:
                                                                                                                            summary = ', '.join([_get_desired_pkg(x, desired)
                                                                                                                Severity: Major
                                                                                                                Found in salt/states/pkg.py and 3 other locations - About 30 mins to fix
                                                                                                                salt/states/pkg.py on lines 1703..1706
                                                                                                                salt/states/pkg.py on lines 1866..1869
                                                                                                                salt/states/pkg.py on lines 1901..1904

                                                                                                                Duplicated Code

                                                                                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                                Tuning

                                                                                                                This issue has a mass of 40.

                                                                                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                                Refactorings

                                                                                                                Further Reading

                                                                                                                Similar blocks of code found in 4 locations. Consider refactoring.
                                                                                                                Open

                                                                                                                        if sources:
                                                                                                                            summary = ', '.join(modified)
                                                                                                                        else:
                                                                                                                            summary = ', '.join([_get_desired_pkg(x, desired)
                                                                                                                Severity: Major
                                                                                                                Found in salt/states/pkg.py and 3 other locations - About 30 mins to fix
                                                                                                                salt/states/pkg.py on lines 1703..1706
                                                                                                                salt/states/pkg.py on lines 1901..1904
                                                                                                                salt/states/pkg.py on lines 1925..1928

                                                                                                                Duplicated Code

                                                                                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                                Tuning

                                                                                                                This issue has a mass of 40.

                                                                                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                                Refactorings

                                                                                                                Further Reading

                                                                                                                Similar blocks of code found in 4 locations. Consider refactoring.
                                                                                                                Open

                                                                                                                        if sources:
                                                                                                                            summary = ', '.join(not_modified)
                                                                                                                        else:
                                                                                                                            summary = ', '.join([_get_desired_pkg(x, desired)
                                                                                                                Severity: Major
                                                                                                                Found in salt/states/pkg.py and 3 other locations - About 30 mins to fix
                                                                                                                salt/states/pkg.py on lines 1703..1706
                                                                                                                salt/states/pkg.py on lines 1866..1869
                                                                                                                salt/states/pkg.py on lines 1925..1928

                                                                                                                Duplicated Code

                                                                                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                                Tuning

                                                                                                                This issue has a mass of 40.

                                                                                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                                Refactorings

                                                                                                                Further Reading

                                                                                                                Similar blocks of code found in 4 locations. Consider refactoring.
                                                                                                                Open

                                                                                                                            if sources:
                                                                                                                                summary = ', '.join(targets)
                                                                                                                            else:
                                                                                                                                summary = ', '.join([_get_desired_pkg(x, targets)
                                                                                                                Severity: Major
                                                                                                                Found in salt/states/pkg.py and 3 other locations - About 30 mins to fix
                                                                                                                salt/states/pkg.py on lines 1866..1869
                                                                                                                salt/states/pkg.py on lines 1901..1904
                                                                                                                salt/states/pkg.py on lines 1925..1928

                                                                                                                Duplicated Code

                                                                                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                                Tuning

                                                                                                                This issue has a mass of 40.

                                                                                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                                Refactorings

                                                                                                                Further Reading

                                                                                                                Similar blocks of code found in 2 locations. Consider refactoring.
                                                                                                                Open

                                                                                                                    partially_installed = diff['mandatory']['installed'] \
                                                                                                                        or diff['default']['installed'] \
                                                                                                                        or diff['optional']['installed']
                                                                                                                Severity: Minor
                                                                                                                Found in salt/states/pkg.py and 1 other location - About 30 mins to fix
                                                                                                                salt/runners/vistara.py on lines 60..63

                                                                                                                Duplicated Code

                                                                                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                                Tuning

                                                                                                                This issue has a mass of 40.

                                                                                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                                Refactorings

                                                                                                                Further Reading

                                                                                                                There are no issues that match your filters.

                                                                                                                Category
                                                                                                                Status