saltstack/salt

View on GitHub
salt/modules/aptpkg.py

Summary

Maintainability
F
1 mo
Test Coverage

File aptpkg.py has 2231 lines of code (exceeds 250 allowed). Consider refactoring.
Open

# -*- coding: utf-8 -*-
'''
Support for APT (Advanced Packaging Tool)

.. important::
Severity: Major
Found in salt/modules/aptpkg.py - About 6 days to fix

    Function mod_repo has a Cognitive Complexity of 160 (exceeds 5 allowed). Consider refactoring.
    Open

    def mod_repo(repo, saltenv='base', **kwargs):
        '''
        Modify one or more values for a repo.  If the repo does not exist, it will
        be created, so long as the definition is well formed.  For Ubuntu the
        ``ppa:<project>/repo`` format is acceptable. ``ppa:`` format can only be
    Severity: Minor
    Found in salt/modules/aptpkg.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

    Function install has a Cognitive Complexity of 142 (exceeds 5 allowed). Consider refactoring.
    Open

    def install(name=None,
                refresh=False,
                fromrepo=None,
                skip_verify=False,
                debconf=None,
    Severity: Minor
    Found in salt/modules/aptpkg.py - About 2 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 del_repo has a Cognitive Complexity of 82 (exceeds 5 allowed). Consider refactoring.
    Open

    def del_repo(repo, **kwargs):
        '''
        Delete a repo from the sources.list / sources.list.d
    
        If the .list file is in the sources.list.d directory
    Severity: Minor
    Found in salt/modules/aptpkg.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

    Cyclomatic complexity is too high in function install. (79)
    Open

    def install(name=None,
                refresh=False,
                fromrepo=None,
                skip_verify=False,
                debconf=None,
    Severity: Minor
    Found in salt/modules/aptpkg.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 mod_repo. (64)
    Open

    def mod_repo(repo, saltenv='base', **kwargs):
        '''
        Modify one or more values for a repo.  If the repo does not exist, it will
        be created, so long as the definition is well formed.  For Ubuntu the
        ``ppa:<project>/repo`` format is acceptable. ``ppa:`` format can only be
    Severity: Minor
    Found in salt/modules/aptpkg.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 get_repo has a Cognitive Complexity of 55 (exceeds 5 allowed). Consider refactoring.
    Open

    def get_repo(repo, **kwargs):
        '''
        Display a repo from the sources.list / sources.list.d
    
        The repo passed in needs to be a complete repo entry.
    Severity: Minor
    Found in salt/modules/aptpkg.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 set_selections has a Cognitive Complexity of 39 (exceeds 5 allowed). Consider refactoring.
    Open

    def set_selections(path=None, selection=None, clear=False, saltenv='base'):
        '''
        Change package state in the dpkg database.
    
        The state can be any one of, documented in ``dpkg(1)``:
    Severity: Minor
    Found in salt/modules/aptpkg.py - About 5 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 list_pkgs has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring.
    Open

    def list_pkgs(versions_as_list=False,
                  removed=False,
                  purge_desired=False,
                  **kwargs):  # pylint: disable=W0613
        '''
    Severity: Minor
    Found in salt/modules/aptpkg.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

    Function latest_version has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring.
    Open

    def latest_version(*names, **kwargs):
        '''
        Return the latest version of the named package available for upgrade or
        installation. If more than one package name is specified, a dict of
        name/version pairs is returned.
    Severity: Minor
    Found in salt/modules/aptpkg.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 del_repo. (34)
    Open

    def del_repo(repo, **kwargs):
        '''
        Delete a repo from the sources.list / sources.list.d
    
        If the .list file is in the sources.list.d directory
    Severity: Minor
    Found in salt/modules/aptpkg.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 expand_repo_def has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
    Open

    def expand_repo_def(**kwargs):
        '''
        Take a repository definition and expand it to the full pkg repository dict
        that can be used for comparison.  This is a helper function to make
        the Debian/Ubuntu apt sources sane for comparison in the pkgrepo states.
    Severity: Minor
    Found in salt/modules/aptpkg.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 show has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
    Open

    def show(*names, **kwargs):
        '''
        .. versionadded:: 2019.2.0
    
        Runs an ``apt-cache show`` on the passed package names, and returns the
    Severity: Minor
    Found in salt/modules/aptpkg.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 unhold has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
    Open

    def unhold(name=None, pkgs=None, sources=None, **kwargs):  # pylint: disable=W0613
        '''
        .. versionadded:: 2014.7.0
    
        Set package current in 'hold' state to install state,
    Severity: Minor
    Found in salt/modules/aptpkg.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 refresh_db has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
    Open

    def refresh_db(cache_valid_time=0, failhard=False, **kwargs):
        '''
        Updates the APT database to latest packages based upon repositories
    
        Returns a dict, with the keys being package databases and the values being
    Severity: Minor
    Found in salt/modules/aptpkg.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 get_repo_keys has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
    Open

    def get_repo_keys():
        '''
        .. versionadded:: 2017.7.0
    
        List known repo key details.
    Severity: Minor
    Found in salt/modules/aptpkg.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 hold has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
    Open

    def hold(name=None, pkgs=None, sources=None, **kwargs):  # pylint: disable=W0613
        '''
        .. versionadded:: 2014.7.0
    
        Set package in 'hold' state, meaning it will not be upgraded.
    Severity: Minor
    Found in salt/modules/aptpkg.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 info_installed has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
    Open

    def info_installed(*names, **kwargs):
        '''
        Return the information of the named package(s) installed on the system.
    
        .. versionadded:: 2015.8.1
    Severity: Minor
    Found in salt/modules/aptpkg.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

    Cyclomatic complexity is too high in function set_selections. (24)
    Open

    def set_selections(path=None, selection=None, clear=False, saltenv='base'):
        '''
        Change package state in the dpkg database.
    
        The state can be any one of, documented in ``dpkg(1)``:
    Severity: Minor
    Found in salt/modules/aptpkg.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 autoremove has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
    Open

    def autoremove(list_only=False, purge=False):
        '''
        .. versionadded:: 2015.5.0
    
        Remove packages not required by another package using ``apt-get
    Severity: Minor
    Found in salt/modules/aptpkg.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

    Cyclomatic complexity is too high in function list_pkgs. (23)
    Open

    def list_pkgs(versions_as_list=False,
                  removed=False,
                  purge_desired=False,
                  **kwargs):  # pylint: disable=W0613
        '''
    Severity: Minor
    Found in salt/modules/aptpkg.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 version_cmp has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
    Open

    def version_cmp(pkg1, pkg2, ignore_epoch=False, **kwargs):
        '''
        Do a cmp-style comparison on two packages. Return -1 if pkg1 < pkg2, 0 if
        pkg1 == pkg2, and 1 if pkg1 > pkg2. Return None if there was a problem
        making the comparison.
    Severity: Minor
    Found in salt/modules/aptpkg.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 add_repo_key has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
    Open

    def add_repo_key(path=None, text=None, keyserver=None, keyid=None, saltenv='base'):
        '''
        .. versionadded:: 2017.7.0
    
        Add a repo key using ``apt-key add``.
    Severity: Minor
    Found in salt/modules/aptpkg.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 del_repo_key has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
    Open

    def del_repo_key(name=None, **kwargs):
        '''
        .. versionadded:: 2015.8.0
    
        Remove a repo key using ``apt-key del``
    Severity: Minor
    Found in salt/modules/aptpkg.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 list_repo_pkgs has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
    Open

    def list_repo_pkgs(*args, **kwargs):  # pylint: disable=unused-import
        '''
        .. versionadded:: 2017.7.0
    
        Returns all available packages. Optionally, package names (and name globs)
    Severity: Minor
    Found in salt/modules/aptpkg.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 _skip_source has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
    Open

    def _skip_source(source):
        '''
        Decide to skip source or not.
    
        :param source:
    Severity: Minor
    Found in salt/modules/aptpkg.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 _get_upgradable has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
    Open

    def _get_upgradable(dist_upgrade=True, **kwargs):
        '''
        Utility function to get upgradable packages
    
        Sample return data:
    Severity: Minor
    Found in salt/modules/aptpkg.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 _resolve_deps has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
    Open

    def _resolve_deps(name, pkgs, **kwargs):
        '''
        Installs missing dependencies and marks them as auto installed so they
        are removed when no more manually installed packages depend on them.
    
    
    Severity: Minor
    Found in salt/modules/aptpkg.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 _consolidate_repo_sources has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
    Open

    def _consolidate_repo_sources(sources):
        '''
        Consolidate APT sources.
        '''
        if not isinstance(sources, sourceslist.SourcesList):
    Severity: Minor
    Found in salt/modules/aptpkg.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 _uninstall has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
    Open

    def _uninstall(action='remove', name=None, pkgs=None, **kwargs):
        '''
        remove and purge do identical things but with different apt-get commands,
        this function performs the common logic.
        '''
    Severity: Minor
    Found in salt/modules/aptpkg.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 float(__grains__['osrelease']) < 12.04:
                            cmd = ['apt-add-repository', repo]
                        else:
                            cmd = ['apt-add-repository', '-y', repo]
                        out = _call_apt(cmd, env=env, scope=False, **kwargs)
    Severity: Major
    Found in salt/modules/aptpkg.py - About 45 mins to fix

      Avoid deeply nested control flow statements.
      Open

                          if refresh:
                              refresh_db()
                          return {repo: out}
      Severity: Major
      Found in salt/modules/aptpkg.py - About 45 mins to fix

        Avoid deeply nested control flow statements.
        Open

                            if result['retcode'] != 0:
                                log.error(
                                    'failed to set state %s for package %s',
                                    _state, _pkg
                                )
        Severity: Major
        Found in salt/modules/aptpkg.py - About 45 mins to fix

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

          def _parse_selections(dpkgselection):
              '''
              Parses the format from ``dpkg --get-selections`` and return a format that
              pkg.get_selections and pkg.set_selections work with.
              '''
          Severity: Minor
          Found in salt/modules/aptpkg.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 not source.comps:
                                  try:
                                      sources.remove(source)
                                  except ValueError:
                                      pass
          Severity: Major
          Found in salt/modules/aptpkg.py - About 45 mins to fix

            Avoid deeply nested control flow statements.
            Open

                                for comp in repo_comps:
                                    if comp in sub.get('comps', []):
                                        return sub
                return {}
            Severity: Major
            Found in salt/modules/aptpkg.py - About 45 mins to fix

              Avoid deeply nested control flow statements.
              Open

                                  if os.path.isfile(repo_file):
                                      msg = ('File {1} containing repo \'{0}\' has been '
                                             'removed.')
                                      try:
                                          os.remove(repo_file)
              Severity: Major
              Found in salt/modules/aptpkg.py - About 45 mins to fix

                Avoid deeply nested control flow statements.
                Open

                                    if out['retcode']:
                                        raise CommandExecutionError(
                                            'Unable to add PPA \'{0}\'. \'{1}\' exited with '
                                            'status {2!s}: \'{3}\' '.format(
                                                repo[4:],
                Severity: Major
                Found in salt/modules/aptpkg.py - About 45 mins to fix

                  Avoid deeply nested control flow statements.
                  Open

                                      if target is None:
                                          errors.append(
                                              'No version matching \'{0}{1}\' could be found '
                                              '(available: {2})'.format(
                                                  pkgname,
                  Severity: Major
                  Found in salt/modules/aptpkg.py - About 45 mins to fix

                    Avoid deeply nested control flow statements.
                    Open

                                        if candidate.lower() == '(none)':
                                            candidate = ''
                                    break
                    Severity: Major
                    Found in salt/modules/aptpkg.py - About 45 mins to fix

                      Avoid deeply nested control flow statements.
                      Open

                                          if http_proxy_url:
                                              env = {'http_proxy': http_proxy_url,
                                                     'https_proxy': http_proxy_url}
                                          if float(__grains__['osrelease']) < 12.04:
                      Severity: Major
                      Found in salt/modules/aptpkg.py - About 45 mins to fix

                        Avoid deeply nested control flow statements.
                        Open

                                            if ret['retcode'] != 0:
                                                raise CommandExecutionError(
                                                    'Error: key retrieval failed: {0}'.format(ret['stdout'])
                                                )
                        
                        
                        Severity: Major
                        Found in salt/modules/aptpkg.py - About 45 mins to fix

                          Avoid deeply nested control flow statements.
                          Open

                                              if not repo_comps:
                                                  return sub
                                              for comp in repo_comps:
                          Severity: Major
                          Found in salt/modules/aptpkg.py - About 45 mins to fix

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

                            def upgrade(refresh=True, dist_upgrade=False, **kwargs):
                                '''
                                .. versionchanged:: 2015.8.12,2016.3.3,2016.11.0
                                    On minions running systemd>=205, `systemd-run(1)`_ is now used to
                                    isolate commands which modify installed packages from the
                            Severity: Minor
                            Found in salt/modules/aptpkg.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 not launchpad_ppa_info['private']:
                                                    raise CommandExecutionError(
                                                        'PPA is not private but auth credentials '
                                                        'passed: {0}'.format(repo)
                                                    )
                            Severity: Major
                            Found in salt/modules/aptpkg.py - About 45 mins to fix

                              Avoid deeply nested control flow statements.
                              Open

                                                      if 'keyid' not in kwargs:
                                                          error_str = 'Private PPAs require a ' \
                                                                      'keyid to be specified: {0}/{1}'
                                                          raise CommandExecutionError(
                                                              error_str.format(owner_name, ppa_name)
                              Severity: Major
                              Found in salt/modules/aptpkg.py - About 45 mins to fix

                                Avoid deeply nested control flow statements.
                                Open

                                                    if not _latest_version == _version:
                                                        _refresh_db = True
                                                else:
                                Severity: Major
                                Found in salt/modules/aptpkg.py - About 45 mins to fix

                                  Avoid deeply nested control flow statements.
                                  Wontfix

                                                      if http_proxy_url and keyserver not in no_proxy:
                                                          cmd = ['apt-key', 'adv', '--batch', '--keyserver-options', 'http-proxy={0}'.format(http_proxy_url),
                                                                 '--keyserver', keyserver, '--logger-fd', '1', '--recv-keys', key]
                                                      else:
                                                          cmd = ['apt-key', 'adv', '--batch', '--keyserver', keyserver,
                                  Severity: Major
                                  Found in salt/modules/aptpkg.py - About 45 mins to fix

                                    Avoid deeply nested control flow statements.
                                    Open

                                                        if not source.comps:
                                                            try:
                                                                sources.remove(source)
                                                            except ValueError:
                                                                pass
                                    Severity: Major
                                    Found in salt/modules/aptpkg.py - About 45 mins to fix

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

                                                      if pkgname in has_comparison:
                                                          candidates = _available.get(pkgname, [])
                                                          target = salt.utils.pkg.match_version(
                                                              version_num,
                                                              candidates,
                                      Severity: Major
                                      Found in salt/modules/aptpkg.py and 1 other location - About 5 hrs to fix
                                      salt/modules/yumpkg.py on lines 1483..1502

                                      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 91.

                                      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 (source.type == repo_type
                                                          and source.architectures == repo_architectures
                                                          and source.uri == repo_uri
                                                          and source.dist == repo_dist):
                                      
                                      
                                      Severity: Major
                                      Found in salt/modules/aptpkg.py and 1 other location - About 5 hrs to fix
                                      salt/modules/aptpkg.py on lines 1778..1789

                                      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 (is_ppa and repo_type == 'deb' and source.type == 'deb-src' and
                                                          source.uri == repo_uri and source.dist == repo_dist):
                                      
                                                      s_comps = set(source.comps)
                                                      r_comps = set(repo_comps)
                                      Severity: Major
                                      Found in salt/modules/aptpkg.py and 1 other location - About 5 hrs to fix
                                      salt/modules/aptpkg.py on lines 1760..1773

                                      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

                                              for pkg_source in pkg_params:
                                                  if 'lowpkg.bin_pkg_info' in __salt__:
                                                      deb_info = __salt__['lowpkg.bin_pkg_info'](pkg_source)
                                                  else:
                                                      deb_info = None
                                      Severity: Major
                                      Found in salt/modules/aptpkg.py and 1 other location - About 5 hrs to fix
                                      salt/modules/yumpkg.py on lines 1432..1446

                                      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 94.

                                      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 call['retcode'] != 0:
                                              msg = 'Failed to get upgrades'
                                              for key in ('stderr', 'stdout'):
                                                  if call[key]:
                                                      msg += ': ' + call[key]
                                      Severity: Major
                                      Found in salt/modules/aptpkg.py and 1 other location - About 4 hrs to fix
                                      salt/modules/ebuildpkg.py on lines 309..317

                                      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 79.

                                      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

                                              for pkgname in to_reinstall:
                                                  if pkgname not in ret or pkgname in old:
                                                      ret.update({pkgname: {'old': old.get(pkgname, ''),
                                                                            'new': new.get(pkgname, '')}})
                                      Severity: Major
                                      Found in salt/modules/aptpkg.py and 1 other location - About 2 hrs to fix
                                      salt/modules/opkg.py on lines 572..575

                                      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 60.

                                      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 3 locations. Consider refactoring.
                                      Open

                                                  if HAS_SOFTWAREPROPERTIES:
                                                      if hasattr(softwareproperties.ppa, 'PPAShortcutHandler'):
                                                          repo = softwareproperties.ppa.PPAShortcutHandler(repo).expand(dist)[0]
                                                      else:
                                                          repo = softwareproperties.ppa.expand_ppa_line(repo, dist)[0]
                                      Severity: Major
                                      Found in salt/modules/aptpkg.py and 2 other locations - About 2 hrs to fix
                                      salt/modules/aptpkg.py on lines 1656..1663
                                      salt/modules/aptpkg.py on lines 1728..1741

                                      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

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

                                              if not HAS_SOFTWAREPROPERTIES:
                                                  _warn_software_properties(repo)
                                                  owner_name, ppa_name = repo[4:].split('/')
                                                  if 'ppa_auth' in kwargs:
                                                      auth_info = '{0}@'.format(kwargs['ppa_auth'])
                                      Severity: Major
                                      Found in salt/modules/aptpkg.py and 2 other locations - About 2 hrs to fix
                                      salt/modules/aptpkg.py on lines 1656..1663
                                      salt/modules/aptpkg.py on lines 2423..2427

                                      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

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

                                                      try:
                                                          if hasattr(softwareproperties.ppa, 'PPAShortcutHandler'):
                                                              repo = softwareproperties.ppa.PPAShortcutHandler(
                                                                  repo).expand(dist)[0]
                                                          else:
                                      Severity: Major
                                      Found in salt/modules/aptpkg.py and 2 other locations - About 2 hrs to fix
                                      salt/modules/aptpkg.py on lines 1728..1741
                                      salt/modules/aptpkg.py on lines 2423..2427

                                      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

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

                                          if removed:
                                              ret = ret['removed']
                                          else:
                                              ret = copy.deepcopy(__context__['pkg.list_pkgs']['purge_desired'])
                                              if not purge_desired:
                                      Severity: Major
                                      Found in salt/modules/aptpkg.py and 1 other location - About 2 hrs to fix
                                      salt/modules/aptpkg.py on lines 1253..1258

                                      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

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

                                              if removed:
                                                  ret = copy.deepcopy(__context__['pkg.list_pkgs']['removed'])
                                              else:
                                                  ret = copy.deepcopy(__context__['pkg.list_pkgs']['purge_desired'])
                                                  if not purge_desired:
                                      Severity: Major
                                      Found in salt/modules/aptpkg.py and 1 other location - About 2 hrs to fix
                                      salt/modules/aptpkg.py on lines 1305..1310

                                      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

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

                                          if pkgs:
                                              targets.extend(pkgs)
                                          elif sources:
                                              for source in sources:
                                                  targets.append(next(iter(source)))
                                      Severity: Major
                                      Found in salt/modules/aptpkg.py and 3 other locations - About 2 hrs to fix
                                      salt/modules/aptpkg.py on lines 1177..1183
                                      salt/modules/opkg.py on lines 808..814
                                      salt/modules/opkg.py on lines 880..886

                                      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 51.

                                      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 4 locations. Consider refactoring.
                                      Open

                                          if pkgs:
                                              targets.extend(pkgs)
                                          elif sources:
                                              for source in sources:
                                                  targets.append(next(iter(source)))
                                      Severity: Major
                                      Found in salt/modules/aptpkg.py and 3 other locations - About 2 hrs to fix
                                      salt/modules/aptpkg.py on lines 1103..1109
                                      salt/modules/opkg.py on lines 808..814
                                      salt/modules/opkg.py on lines 880..886

                                      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 51.

                                      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

                                                  key_props.update({
                                                      'algorithm': items[3],
                                                      'bits': items[2],
                                                      'capability': items[11],
                                                      'date_creation': items[5],
                                      Severity: Major
                                      Found in salt/modules/aptpkg.py and 1 other location - About 2 hrs to fix
                                      salt/modules/parted_partition.py on lines 171..178

                                      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 59.

                                      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 3 locations. Consider refactoring.
                                      Open

                                          if result['retcode'] != 0:
                                              msg = 'Failed to remove keyid {0}'
                                              if result['stderr']:
                                                  msg += ': {0}'.format(result['stderr'])
                                              raise CommandExecutionError(msg)
                                      Severity: Major
                                      Found in salt/modules/aptpkg.py and 2 other locations - About 1 hr to fix
                                      salt/modules/git.py on lines 2650..2654
                                      salt/modules/nspawn.py on lines 1382..1387

                                      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 'ppa_auth' in kwargs:
                                                      auth_info = '{0}@'.format(kwargs['ppa_auth'])
                                                      repo = LP_PVT_SRC_FORMAT.format(auth_info, dist, owner_name,
                                                                                      ppa_name)
                                                  else:
                                      Severity: Major
                                      Found in salt/modules/aptpkg.py and 1 other location - About 1 hr to fix
                                      salt/modules/aptpkg.py on lines 2200..2205

                                      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 55.

                                      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 'ppa_auth' in kwargs:
                                                          ppa_auth = '{0}@'.format(kwargs['ppa_auth'])
                                                          repo = LP_PVT_SRC_FORMAT.format(ppa_auth, owner_name,
                                                                                          ppa_name, dist)
                                                      else:
                                      Severity: Major
                                      Found in salt/modules/aptpkg.py and 1 other location - About 1 hr to fix
                                      salt/modules/aptpkg.py on lines 1731..1736

                                      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 55.

                                      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 17 locations. Consider refactoring.
                                      Open

                                          if out['retcode'] != 0 and out['stderr']:
                                              errors = [out['stderr']]
                                          else:
                                              errors = []
                                      Severity: Major
                                      Found in salt/modules/aptpkg.py and 16 other locations - About 1 hr to fix
                                      salt/modules/apkpkg.py on lines 334..337
                                      salt/modules/apkpkg.py on lines 410..413
                                      salt/modules/ebuildpkg.py on lines 1034..1037
                                      salt/modules/freebsdpkg.py on lines 409..412
                                      salt/modules/freebsdpkg.py on lines 472..475
                                      salt/modules/mac_brew_pkg.py on lines 261..264
                                      salt/modules/mac_brew_pkg.py on lines 415..418
                                      salt/modules/openbsdpkg.py on lines 299..302
                                      salt/modules/pacmanpkg.py on lines 614..617
                                      salt/modules/pacmanpkg.py on lines 739..742
                                      salt/modules/pkgin.py on lines 429..432
                                      salt/modules/pkgin.py on lines 577..580
                                      salt/modules/pkgng.py on lines 893..896
                                      salt/modules/pkgng.py on lines 1070..1073
                                      salt/modules/solarispkg.py on lines 466..469
                                      salt/modules/yumpkg.py on lines 2018..2021

                                      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 46.

                                      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 3 locations. Consider refactoring.
                                      Open

                                                  if out['retcode'] != 0 and out['stderr']:
                                                      errors.append(out['stderr'])
                                      Severity: Major
                                      Found in salt/modules/aptpkg.py and 2 other locations - About 1 hr to fix
                                      salt/modules/openbsdpkg.py on lines 237..238
                                      salt/modules/solarispkg.py on lines 365..366

                                      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 42.

                                      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

                                              with salt.utils.files.fopen(path, 'r') as ifile:
                                                  content = [salt.utils.stringutils.to_unicode(x)
                                                             for x in ifile.readlines()]
                                      Severity: Minor
                                      Found in salt/modules/aptpkg.py and 1 other location - About 50 mins to fix
                                      salt/states/augeas.py on lines 292..295

                                      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 44.

                                      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 scope and salt.utils.systemd.has_scope(__context__) and __salt__['config.get']('systemd.scope', True):
                                              cmd.extend(['systemd-run', '--scope'])
                                      Severity: Minor
                                      Found in salt/modules/aptpkg.py and 1 other location - About 45 mins to fix
                                      salt/modules/systemd_service.py on lines 330..333

                                      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 5 locations. Consider refactoring.
                                      Open

                                          normalize = lambda x: six.text_type(x).split(':', 1)[-1] \
                                                      if ignore_epoch else six.text_type(x)
                                      Severity: Major
                                      Found in salt/modules/aptpkg.py and 4 other locations - About 40 mins to fix
                                      salt/modules/opkg.py on lines 1215..1215
                                      salt/modules/rpm_lowpkg.py on lines 696..698
                                      salt/states/pip_state.py on lines 306..306
                                      salt/utils/versions.py on lines 243..244

                                      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 42.

                                      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 8 locations. Consider refactoring.
                                      Open

                                              elif salt.utils.data.is_true(state.get('hold', False)):
                                                  if 'test' in __opts__ and __opts__['test']:
                                                      ret[target].update(result=None)
                                                      ret[target]['comment'] = ('Package {0} is set not to be '
                                                                                'held.'.format(target))
                                      Severity: Major
                                      Found in salt/modules/aptpkg.py and 7 other locations - About 35 mins to fix
                                      salt/modules/aptpkg.py on lines 1125..1137
                                      salt/modules/opkg.py on lines 830..842
                                      salt/modules/opkg.py on lines 902..914
                                      salt/modules/pkgng.py on lines 1942..1959
                                      salt/modules/pkgng.py on lines 2007..2024
                                      salt/modules/yumpkg.py on lines 2144..2162
                                      salt/modules/yumpkg.py on lines 2249..2267

                                      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 8 locations. Consider refactoring.
                                      Open

                                              elif not salt.utils.data.is_true(state.get('hold', False)):
                                                  if 'test' in __opts__ and __opts__['test']:
                                                      ret[target].update(result=None)
                                                      ret[target]['comment'] = ('Package {0} is set to be held.'
                                                                                .format(target))
                                      Severity: Major
                                      Found in salt/modules/aptpkg.py and 7 other locations - About 35 mins to fix
                                      salt/modules/aptpkg.py on lines 1199..1211
                                      salt/modules/opkg.py on lines 830..842
                                      salt/modules/opkg.py on lines 902..914
                                      salt/modules/pkgng.py on lines 1942..1959
                                      salt/modules/pkgng.py on lines 2007..2024
                                      salt/modules/yumpkg.py on lines 2144..2162
                                      salt/modules/yumpkg.py on lines 2249..2267

                                      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

                                      There are no issues that match your filters.

                                      Category
                                      Status