saltstack/salt

View on GitHub

Showing 7,542 of 17,590 total issues

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

    __utils__['cloud.fire_event'](
        'event',
        'created instance',
        'salt/cloud/{0}/created'.format(name),
        args=__utils__['cloud.filter_event']('created', vm_, ['name', 'profile', 'provider', 'driver']),
Severity: Major
Found in salt/cloud/clouds/softlayer.py and 10 other locations - About 2 hrs to fix
salt/cloud/clouds/libvirt.py on lines 309..315
salt/cloud/clouds/libvirt.py on lines 459..465
salt/cloud/clouds/linode.py on lines 341..347
salt/cloud/clouds/linode.py on lines 430..436
salt/cloud/clouds/linode.py on lines 528..534
salt/cloud/clouds/packet.py on lines 334..340
salt/cloud/clouds/packet.py on lines 426..432
salt/cloud/clouds/softlayer.py on lines 272..278
salt/cloud/clouds/softlayer_hw.py on lines 240..246
salt/cloud/clouds/softlayer_hw.py on lines 416..422

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

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

    __utils__['cloud.fire_event'](
        'event',
        'starting create',
        'salt/cloud/{0}/creating'.format(name),
        args=__utils__['cloud.filter_event']('creating', vm_, ['name', 'profile', 'provider', 'driver']),
Severity: Major
Found in salt/cloud/clouds/softlayer_hw.py and 10 other locations - About 2 hrs to fix
salt/cloud/clouds/libvirt.py on lines 309..315
salt/cloud/clouds/libvirt.py on lines 459..465
salt/cloud/clouds/linode.py on lines 341..347
salt/cloud/clouds/linode.py on lines 430..436
salt/cloud/clouds/linode.py on lines 528..534
salt/cloud/clouds/packet.py on lines 334..340
salt/cloud/clouds/packet.py on lines 426..432
salt/cloud/clouds/softlayer.py on lines 272..278
salt/cloud/clouds/softlayer.py on lines 514..520
salt/cloud/clouds/softlayer_hw.py on lines 416..422

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

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

    __utils__['cloud.fire_event'](
        'event',
        'created instance',
        'salt/cloud/{0}/created'.format(name),
        args=__utils__['cloud.filter_event']('created', vm_, ['name', 'profile', 'provider', 'driver']),
Severity: Major
Found in salt/cloud/clouds/softlayer_hw.py and 10 other locations - About 2 hrs to fix
salt/cloud/clouds/libvirt.py on lines 309..315
salt/cloud/clouds/libvirt.py on lines 459..465
salt/cloud/clouds/linode.py on lines 341..347
salt/cloud/clouds/linode.py on lines 430..436
salt/cloud/clouds/linode.py on lines 528..534
salt/cloud/clouds/packet.py on lines 334..340
salt/cloud/clouds/packet.py on lines 426..432
salt/cloud/clouds/softlayer.py on lines 272..278
salt/cloud/clouds/softlayer.py on lines 514..520
salt/cloud/clouds/softlayer_hw.py on lines 240..246

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

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

    __utils__['cloud.fire_event'](
        'event',
        'starting create',
        'salt/cloud/{0}/creating'.format(name),
        args=__utils__['cloud.filter_event']('creating', vm_, ['name', 'profile', 'provider', 'driver']),
Severity: Major
Found in salt/cloud/clouds/linode.py and 10 other locations - About 2 hrs to fix
salt/cloud/clouds/libvirt.py on lines 309..315
salt/cloud/clouds/libvirt.py on lines 459..465
salt/cloud/clouds/linode.py on lines 430..436
salt/cloud/clouds/linode.py on lines 528..534
salt/cloud/clouds/packet.py on lines 334..340
salt/cloud/clouds/packet.py on lines 426..432
salt/cloud/clouds/softlayer.py on lines 272..278
salt/cloud/clouds/softlayer.py on lines 514..520
salt/cloud/clouds/softlayer_hw.py on lines 240..246
salt/cloud/clouds/softlayer_hw.py on lines 416..422

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

def info(name):
    '''
    Return information about a group

    CLI Example:
Severity: Major
Found in salt/modules/solaris_group.py and 2 other locations - About 2 hrs to fix
salt/modules/aix_group.py on lines 78..96
salt/modules/pw_group.py on lines 83..101

Duplicated Code

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

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

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

Tuning

This issue has a mass of 52.

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

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

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

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

Refactorings

Further Reading

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

def info(name):
    '''
    Return information about a group

    CLI Example:
Severity: Major
Found in salt/modules/pw_group.py and 2 other locations - About 2 hrs to fix
salt/modules/aix_group.py on lines 78..96
salt/modules/solaris_group.py on lines 83..101

Duplicated Code

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

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

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

Tuning

This issue has a mass of 52.

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

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

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

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

Refactorings

Further Reading

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

def info(name):
    '''
    Return information about a group

    CLI Example:
Severity: Major
Found in salt/modules/aix_group.py and 2 other locations - About 2 hrs to fix
salt/modules/pw_group.py on lines 83..101
salt/modules/solaris_group.py on lines 83..101

Duplicated Code

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

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

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

Tuning

This issue has a mass of 52.

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

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

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

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

Refactorings

Further Reading

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

CreateDataType('vim.host.VsanVmdkLoadTestSpec', 'VsanVmdkLoadTestSpec', 'vmodl.DynamicData', 'vim.version.version9', [('vmdkCreateSpec', 'vim.VirtualDiskManager.FileBackedVirtualDiskSpec', 'vim.version.version9', 0 | F_OPTIONAL), ('vmdkIOSpec', 'vim.host.VsanVmdkIOLoadSpec', 'vim.version.version9', 0 | F_OPTIONAL), ('vmdkIOSpecSequence', 'vim.host.VsanVmdkIOLoadSpec[]', 'vim.version.version9', 0 | F_OPTIONAL), ('stepDurationSec', 'long', 'vim.version.version9', 0 | F_OPTIONAL)])
Severity: Major
Found in salt/ext/vsan/vsanmgmtObjects.py and 4 other locations - About 2 hrs to fix
salt/ext/vsan/vsanmgmtObjects.py on lines 42..42
salt/ext/vsan/vsanmgmtObjects.py on lines 78..78
salt/ext/vsan/vsanmgmtObjects.py on lines 80..80
salt/ext/vsan/vsanmgmtObjects.py on lines 83..83

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

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

CreateDataType('vim.cluster.VsanClusterHealthConfigs', 'VsanClusterHealthConfigs', 'vmodl.DynamicData', 'vim.version.version9', [('enableVsanTelemetry', 'boolean', 'vim.version.version9', 0 | F_OPTIONAL), ('vsanTelemetryInterval', 'int', 'vim.version.version9', 0 | F_OPTIONAL), ('vsanTelemetryProxy', 'vim.cluster.VsanClusterTelemetryProxyConfig', 'vim.version.version9', 0 | F_OPTIONAL), ('configs', 'vim.cluster.VsanClusterHealthResultKeyValuePair[]', 'vim.version.version9', 0 | F_OPTIONAL)])
Severity: Major
Found in salt/ext/vsan/vsanmgmtObjects.py and 4 other locations - About 2 hrs to fix
salt/ext/vsan/vsanmgmtObjects.py on lines 42..42
salt/ext/vsan/vsanmgmtObjects.py on lines 80..80
salt/ext/vsan/vsanmgmtObjects.py on lines 83..83
salt/ext/vsan/vsanmgmtObjects.py on lines 97..97

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

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

CreateDataType('vim.cluster.VsanObjectIdentityAndHealth', 'VsanObjectIdentityAndHealth', 'vmodl.DynamicData', 'vim.version.version9', [('identities', 'vim.cluster.VsanObjectIdentity[]', 'vim.version.version9', 0 | F_OPTIONAL), ('health', 'vim.host.VsanObjectOverallHealth', 'vim.version.version9', 0 | F_OPTIONAL), ('spaceSummary', 'vim.cluster.VsanObjectSpaceSummary[]', 'vim.version.version9', 0 | F_OPTIONAL), ('rawData', 'string', 'vim.version.version9', 0 | F_OPTIONAL)])
Severity: Major
Found in salt/ext/vsan/vsanmgmtObjects.py and 4 other locations - About 2 hrs to fix
salt/ext/vsan/vsanmgmtObjects.py on lines 42..42
salt/ext/vsan/vsanmgmtObjects.py on lines 78..78
salt/ext/vsan/vsanmgmtObjects.py on lines 83..83
salt/ext/vsan/vsanmgmtObjects.py on lines 97..97

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

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

CreateDataType('vim.cluster.StorageOperationalStatus', 'VsanStorageOperationalStatus', 'vmodl.DynamicData', 'vim.version.version9', [('healthy', 'boolean', 'vim.version.version9', 0 | F_OPTIONAL), ('operationETA', 'vmodl.DateTime', 'vim.version.version9', 0 | F_OPTIONAL), ('operationProgress', 'long', 'vim.version.version9', 0 | F_OPTIONAL), ('transitional', 'boolean', 'vim.version.version9', 0 | F_OPTIONAL)])
Severity: Major
Found in salt/ext/vsan/vsanmgmtObjects.py and 4 other locations - About 2 hrs to fix
salt/ext/vsan/vsanmgmtObjects.py on lines 42..42
salt/ext/vsan/vsanmgmtObjects.py on lines 78..78
salt/ext/vsan/vsanmgmtObjects.py on lines 80..80
salt/ext/vsan/vsanmgmtObjects.py on lines 97..97

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

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

CreateDataType('vim.cluster.VsanVsanClusterPcapResult', 'VsanVsanClusterPcapResult', 'vmodl.DynamicData', 'vim.version.version9', [('pkts', 'string[]', 'vim.version.version9', 0 | F_OPTIONAL), ('groups', 'vim.cluster.VsanVsanClusterPcapGroup[]', 'vim.version.version9', 0 | F_OPTIONAL), ('issues', 'string[]', 'vim.version.version9', 0 | F_OPTIONAL), ('hostResults', 'vim.host.VsanVsanPcapResult[]', 'vim.version.version9', 0 | F_OPTIONAL)])
Severity: Major
Found in salt/ext/vsan/vsanmgmtObjects.py and 4 other locations - About 2 hrs to fix
salt/ext/vsan/vsanmgmtObjects.py on lines 78..78
salt/ext/vsan/vsanmgmtObjects.py on lines 80..80
salt/ext/vsan/vsanmgmtObjects.py on lines 83..83
salt/ext/vsan/vsanmgmtObjects.py on lines 97..97

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

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

    try:
        st_ = salt.state.HighState(opts,
                                   pillar_override,
                                   pillar_enc=pillar_enc,
                                   proxy=__proxy__,
Severity: Major
Found in salt/modules/state.py and 3 other locations - About 2 hrs to fix
salt/modules/state.py on lines 1508..1518
salt/modules/state.py on lines 1919..1929
salt/modules/state.py on lines 2085..2095

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

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

def info(name, quiet=False, path=None):
    '''
    Returns information about a container.

    path
Severity: Major
Found in salt/runners/lxc.py and 3 other locations - About 2 hrs to fix
salt/runners/lxc.py on lines 524..542
salt/runners/lxc.py on lines 545..563
salt/runners/lxc.py on lines 587..605

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

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

    try:
        response = bigip_session.post(
            BIG_IP_URL_BASE.format(host=hostname) + '/ltm/virtual',
            data=salt.utils.json.dumps(payload)
        )
Severity: Major
Found in salt/modules/bigip.py and 3 other locations - About 2 hrs to fix
salt/modules/bigip.py on lines 248..254
salt/modules/bigip.py on lines 462..467
salt/modules/bigip.py on lines 765..771

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

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

    try:
        response = bigip_session.post(
            BIG_IP_URL_BASE.format(host=hostname) + '/ltm/pool',
            data=salt.utils.json.dumps(payload)
        )
Severity: Major
Found in salt/modules/bigip.py and 3 other locations - About 2 hrs to fix
salt/modules/bigip.py on lines 248..254
salt/modules/bigip.py on lines 462..467
salt/modules/bigip.py on lines 1515..1521

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

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

    try:
        st_ = salt.state.HighState(opts,
                                   pillar_override,
                                   pillar_enc=pillar_enc,
                                   proxy=__proxy__,
Severity: Major
Found in salt/modules/state.py and 3 other locations - About 2 hrs to fix
salt/modules/state.py on lines 1508..1518
salt/modules/state.py on lines 1723..1733
salt/modules/state.py on lines 2085..2095

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

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

    try:
        st_ = salt.state.State(opts,
                               pillar_override,
                               pillar_enc=pillar_enc,
                               proxy=__proxy__,
Severity: Major
Found in salt/modules/state.py and 3 other locations - About 2 hrs to fix
salt/modules/state.py on lines 1508..1518
salt/modules/state.py on lines 1723..1733
salt/modules/state.py on lines 1919..1929

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

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

    try:
        st_ = salt.state.HighState(opts,
                                   pillar_override,
                                   pillar_enc=pillar_enc,
                                   proxy=__proxy__,
Severity: Major
Found in salt/modules/state.py and 3 other locations - About 2 hrs to fix
salt/modules/state.py on lines 1723..1733
salt/modules/state.py on lines 1919..1929
salt/modules/state.py on lines 2085..2095

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

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

def stop(name, quiet=False, path=None):
    '''
    Stop the named container.

    path
Severity: Major
Found in salt/runners/lxc.py and 3 other locations - About 2 hrs to fix
salt/runners/lxc.py on lines 524..542
salt/runners/lxc.py on lines 587..605
salt/runners/lxc.py on lines 608..626

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

Severity
Category
Status
Source
Language