saltstack/salt

View on GitHub

Showing 7,542 of 17,590 total issues

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

    if salt.utils.systemd.has_scope(__context__) \
            and __salt__['config.get']('systemd.scope', True):
        cmd.extend(['systemd-run', '--scope'])
Severity: Major
Found in salt/modules/kernelpkg_linux_yum.py and 10 other locations - About 1 hr to fix
salt/modules/ebuildpkg.py on lines 740..742
salt/modules/ebuildpkg.py on lines 831..833
salt/modules/ebuildpkg.py on lines 923..925
salt/modules/ebuildpkg.py on lines 1019..1021
salt/modules/pacmanpkg.py on lines 539..541
salt/modules/pacmanpkg.py on lines 680..682
salt/modules/pacmanpkg.py on lines 724..726
salt/modules/systemd_service.py on lines 1162..1164
salt/modules/systemd_service.py on lines 1221..1223
salt/modules/yumpkg.py on lines 165..166

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

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

        if tags:
            for tag_name, tag_value in six.iteritems(tags):
                filter_parameters['filters']['tag:{0}'.format(tag_name)] = tag_value
Severity: Major
Found in salt/modules/boto_vpc.py and 9 other locations - About 1 hr to fix
salt/modules/boto_ec2.py on lines 583..585
salt/modules/boto_ec2.py on lines 673..675
salt/modules/boto_secgroup.py on lines 576..578
salt/modules/boto_vpc.py on lines 399..401
salt/modules/boto_vpc.py on lines 507..509
salt/modules/boto_vpc.py on lines 788..790
salt/modules/boto_vpc.py on lines 828..830
salt/modules/boto_vpc.py on lines 947..949
salt/modules/boto_vpc.py on lines 2505..2507

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

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

    if tags:
        for tag_name, tag_value in six.iteritems(tags):
            filter_parameters['filters']['tag:{0}'.format(tag_name)] = tag_value
Severity: Major
Found in salt/modules/boto_vpc.py and 9 other locations - About 1 hr to fix
salt/modules/boto_ec2.py on lines 583..585
salt/modules/boto_ec2.py on lines 673..675
salt/modules/boto_secgroup.py on lines 576..578
salt/modules/boto_vpc.py on lines 399..401
salt/modules/boto_vpc.py on lines 507..509
salt/modules/boto_vpc.py on lines 788..790
salt/modules/boto_vpc.py on lines 828..830
salt/modules/boto_vpc.py on lines 2149..2151
salt/modules/boto_vpc.py on lines 2505..2507

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

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

    if tags:
        for tag_name, tag_value in six.iteritems(tags):
            filter_parameters['filters']['tag:{0}'.format(tag_name)] = tag_value
Severity: Major
Found in salt/modules/boto_secgroup.py and 9 other locations - About 1 hr to fix
salt/modules/boto_ec2.py on lines 583..585
salt/modules/boto_ec2.py on lines 673..675
salt/modules/boto_vpc.py on lines 399..401
salt/modules/boto_vpc.py on lines 507..509
salt/modules/boto_vpc.py on lines 788..790
salt/modules/boto_vpc.py on lines 828..830
salt/modules/boto_vpc.py on lines 947..949
salt/modules/boto_vpc.py on lines 2149..2151
salt/modules/boto_vpc.py on lines 2505..2507

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

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

    if salt.utils.systemd.has_scope(__context__) \
            and __salt__['config.get']('systemd.scope', True):
        cmd.extend(['systemd-run', '--scope'])
Severity: Major
Found in salt/modules/pacmanpkg.py and 10 other locations - About 1 hr to fix
salt/modules/ebuildpkg.py on lines 740..742
salt/modules/ebuildpkg.py on lines 831..833
salt/modules/ebuildpkg.py on lines 923..925
salt/modules/ebuildpkg.py on lines 1019..1021
salt/modules/kernelpkg_linux_yum.py on lines 222..224
salt/modules/pacmanpkg.py on lines 539..541
salt/modules/pacmanpkg.py on lines 680..682
salt/modules/systemd_service.py on lines 1162..1164
salt/modules/systemd_service.py on lines 1221..1223
salt/modules/yumpkg.py on lines 165..166

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

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

    if salt.utils.systemd.has_scope(__context__) \
            and __salt__['config.get']('systemd.scope', True):
        cmd.extend(['systemd-run', '--scope'])
Severity: Major
Found in salt/modules/ebuildpkg.py and 10 other locations - About 1 hr to fix
salt/modules/ebuildpkg.py on lines 740..742
salt/modules/ebuildpkg.py on lines 831..833
salt/modules/ebuildpkg.py on lines 923..925
salt/modules/kernelpkg_linux_yum.py on lines 222..224
salt/modules/pacmanpkg.py on lines 539..541
salt/modules/pacmanpkg.py on lines 680..682
salt/modules/pacmanpkg.py on lines 724..726
salt/modules/systemd_service.py on lines 1162..1164
salt/modules/systemd_service.py on lines 1221..1223
salt/modules/yumpkg.py on lines 165..166

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

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

            if tags:
                for tag_name, tag_value in six.iteritems(tags):
                    filter_parameters['filters']['tag:{0}'.format(tag_name)] = tag_value
Severity: Major
Found in salt/modules/boto_ec2.py and 9 other locations - About 1 hr to fix
salt/modules/boto_ec2.py on lines 583..585
salt/modules/boto_secgroup.py on lines 576..578
salt/modules/boto_vpc.py on lines 399..401
salt/modules/boto_vpc.py on lines 507..509
salt/modules/boto_vpc.py on lines 788..790
salt/modules/boto_vpc.py on lines 828..830
salt/modules/boto_vpc.py on lines 947..949
salt/modules/boto_vpc.py on lines 2149..2151
salt/modules/boto_vpc.py on lines 2505..2507

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

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

    if tags:
        for tag_name, tag_value in six.iteritems(tags):
            filter_parameters['filters']['tag:{0}'.format(tag_name)] = tag_value
Severity: Major
Found in salt/modules/boto_vpc.py and 9 other locations - About 1 hr to fix
salt/modules/boto_ec2.py on lines 583..585
salt/modules/boto_ec2.py on lines 673..675
salt/modules/boto_secgroup.py on lines 576..578
salt/modules/boto_vpc.py on lines 507..509
salt/modules/boto_vpc.py on lines 788..790
salt/modules/boto_vpc.py on lines 828..830
salt/modules/boto_vpc.py on lines 947..949
salt/modules/boto_vpc.py on lines 2149..2151
salt/modules/boto_vpc.py on lines 2505..2507

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

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

        if tags:
            for tag_name, tag_value in six.iteritems(tags):
                filter_parameters['filters']['tag:{0}'.format(tag_name)] = tag_value
Severity: Major
Found in salt/modules/boto_vpc.py and 9 other locations - About 1 hr to fix
salt/modules/boto_ec2.py on lines 583..585
salt/modules/boto_ec2.py on lines 673..675
salt/modules/boto_secgroup.py on lines 576..578
salt/modules/boto_vpc.py on lines 399..401
salt/modules/boto_vpc.py on lines 507..509
salt/modules/boto_vpc.py on lines 788..790
salt/modules/boto_vpc.py on lines 828..830
salt/modules/boto_vpc.py on lines 947..949
salt/modules/boto_vpc.py on lines 2149..2151

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

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

    if salt.utils.systemd.has_scope(__context__) \
            and __salt__['config.get']('systemd.scope', True):
        cmd.extend(['systemd-run', '--scope'])
Severity: Major
Found in salt/modules/ebuildpkg.py and 10 other locations - About 1 hr to fix
salt/modules/ebuildpkg.py on lines 831..833
salt/modules/ebuildpkg.py on lines 923..925
salt/modules/ebuildpkg.py on lines 1019..1021
salt/modules/kernelpkg_linux_yum.py on lines 222..224
salt/modules/pacmanpkg.py on lines 539..541
salt/modules/pacmanpkg.py on lines 680..682
salt/modules/pacmanpkg.py on lines 724..726
salt/modules/systemd_service.py on lines 1162..1164
salt/modules/systemd_service.py on lines 1221..1223
salt/modules/yumpkg.py on lines 165..166

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

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

        if salt.utils.systemd.has_scope(__context__) \
                and __salt__['config.get']('systemd.scope', True):
            cmd.extend(['systemd-run', '--scope'])
Severity: Major
Found in salt/modules/systemd_service.py and 10 other locations - About 1 hr to fix
salt/modules/ebuildpkg.py on lines 740..742
salt/modules/ebuildpkg.py on lines 831..833
salt/modules/ebuildpkg.py on lines 923..925
salt/modules/ebuildpkg.py on lines 1019..1021
salt/modules/kernelpkg_linux_yum.py on lines 222..224
salt/modules/pacmanpkg.py on lines 539..541
salt/modules/pacmanpkg.py on lines 680..682
salt/modules/pacmanpkg.py on lines 724..726
salt/modules/systemd_service.py on lines 1221..1223
salt/modules/yumpkg.py on lines 165..166

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

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

    if salt.utils.systemd.has_scope(__context__) \
            and __salt__['config.get']('systemd.scope', True):
        cmd.extend(['systemd-run', '--scope'])
Severity: Major
Found in salt/modules/pacmanpkg.py and 10 other locations - About 1 hr to fix
salt/modules/ebuildpkg.py on lines 740..742
salt/modules/ebuildpkg.py on lines 831..833
salt/modules/ebuildpkg.py on lines 923..925
salt/modules/ebuildpkg.py on lines 1019..1021
salt/modules/kernelpkg_linux_yum.py on lines 222..224
salt/modules/pacmanpkg.py on lines 680..682
salt/modules/pacmanpkg.py on lines 724..726
salt/modules/systemd_service.py on lines 1162..1164
salt/modules/systemd_service.py on lines 1221..1223
salt/modules/yumpkg.py on lines 165..166

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

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

    if salt.utils.systemd.has_scope(__context__) \
            and __salt__['config.get']('systemd.scope', True):
        cmd.extend(['systemd-run', '--scope'])
Severity: Major
Found in salt/modules/ebuildpkg.py and 10 other locations - About 1 hr to fix
salt/modules/ebuildpkg.py on lines 740..742
salt/modules/ebuildpkg.py on lines 923..925
salt/modules/ebuildpkg.py on lines 1019..1021
salt/modules/kernelpkg_linux_yum.py on lines 222..224
salt/modules/pacmanpkg.py on lines 539..541
salt/modules/pacmanpkg.py on lines 680..682
salt/modules/pacmanpkg.py on lines 724..726
salt/modules/systemd_service.py on lines 1162..1164
salt/modules/systemd_service.py on lines 1221..1223
salt/modules/yumpkg.py on lines 165..166

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

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

        if tags:
            for tag_name, tag_value in six.iteritems(tags):
                filter_parameters['filters']['tag:{0}'.format(tag_name)] = tag_value
Severity: Major
Found in salt/modules/boto_vpc.py and 9 other locations - About 1 hr to fix
salt/modules/boto_ec2.py on lines 583..585
salt/modules/boto_ec2.py on lines 673..675
salt/modules/boto_secgroup.py on lines 576..578
salt/modules/boto_vpc.py on lines 399..401
salt/modules/boto_vpc.py on lines 507..509
salt/modules/boto_vpc.py on lines 828..830
salt/modules/boto_vpc.py on lines 947..949
salt/modules/boto_vpc.py on lines 2149..2151
salt/modules/boto_vpc.py on lines 2505..2507

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

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

        if salt.utils.systemd.has_scope(__context__) \
                and __salt__['config.get']('systemd.scope', True):
            cmd.extend(['systemd-run', '--scope'])
Severity: Major
Found in salt/modules/systemd_service.py and 10 other locations - About 1 hr to fix
salt/modules/ebuildpkg.py on lines 740..742
salt/modules/ebuildpkg.py on lines 831..833
salt/modules/ebuildpkg.py on lines 923..925
salt/modules/ebuildpkg.py on lines 1019..1021
salt/modules/kernelpkg_linux_yum.py on lines 222..224
salt/modules/pacmanpkg.py on lines 539..541
salt/modules/pacmanpkg.py on lines 680..682
salt/modules/pacmanpkg.py on lines 724..726
salt/modules/systemd_service.py on lines 1162..1164
salt/modules/yumpkg.py on lines 165..166

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

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

    if tags:
        for tag_name, tag_value in six.iteritems(tags):
            filter_parameters['filters']['tag:{0}'.format(tag_name)] = tag_value
Severity: Major
Found in salt/modules/boto_vpc.py and 9 other locations - About 1 hr to fix
salt/modules/boto_ec2.py on lines 583..585
salt/modules/boto_ec2.py on lines 673..675
salt/modules/boto_secgroup.py on lines 576..578
salt/modules/boto_vpc.py on lines 399..401
salt/modules/boto_vpc.py on lines 788..790
salt/modules/boto_vpc.py on lines 828..830
salt/modules/boto_vpc.py on lines 947..949
salt/modules/boto_vpc.py on lines 2149..2151
salt/modules/boto_vpc.py on lines 2505..2507

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

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

    if tags:
        for tag_name, tag_value in six.iteritems(tags):
            filter_parameters['filters']['tag:{0}'.format(tag_name)] = tag_value
Severity: Major
Found in salt/modules/boto_vpc.py and 9 other locations - About 1 hr to fix
salt/modules/boto_ec2.py on lines 583..585
salt/modules/boto_ec2.py on lines 673..675
salt/modules/boto_secgroup.py on lines 576..578
salt/modules/boto_vpc.py on lines 399..401
salt/modules/boto_vpc.py on lines 507..509
salt/modules/boto_vpc.py on lines 788..790
salt/modules/boto_vpc.py on lines 947..949
salt/modules/boto_vpc.py on lines 2149..2151
salt/modules/boto_vpc.py on lines 2505..2507

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

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

    if salt.utils.systemd.has_scope(__context__) \
            and __salt__['config.get']('systemd.scope', True):
        cmd.extend(['systemd-run', '--scope'])
Severity: Major
Found in salt/modules/pacmanpkg.py and 10 other locations - About 1 hr to fix
salt/modules/ebuildpkg.py on lines 740..742
salt/modules/ebuildpkg.py on lines 831..833
salt/modules/ebuildpkg.py on lines 923..925
salt/modules/ebuildpkg.py on lines 1019..1021
salt/modules/kernelpkg_linux_yum.py on lines 222..224
salt/modules/pacmanpkg.py on lines 539..541
salt/modules/pacmanpkg.py on lines 724..726
salt/modules/systemd_service.py on lines 1162..1164
salt/modules/systemd_service.py on lines 1221..1223
salt/modules/yumpkg.py on lines 165..166

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

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

    if not server_version:
        last_err = __context__['mysql.error']
        err = 'MySQL Error: Unable to fetch current server version. Last error was: "{}"'.format(last_err)
        log.error(err)
        return False
Severity: Major
Found in salt/modules/mysql.py and 3 other locations - About 1 hr to fix
salt/modules/mysql.py on lines 1267..1271
salt/modules/mysql.py on lines 1521..1525
salt/modules/mysql.py on lines 1882..1886

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

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

    if not server_version:
        last_err = __context__['mysql.error']
        err = 'MySQL Error: Unable to fetch current server version. Last error was: "{}"'.format(last_err)
        log.error(err)
        return False
Severity: Major
Found in salt/modules/mysql.py and 3 other locations - About 1 hr to fix
salt/modules/mysql.py on lines 1411..1415
salt/modules/mysql.py on lines 1521..1525
salt/modules/mysql.py on lines 1882..1886

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

Severity
Category
Status
Source
Language