saltstack/salt

View on GitHub

Showing 7,542 of 17,590 total issues

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

    __utils__['cloud.fire_event'](
        'event',
        'starting create',
        'salt/cloud/{0}/creating'.format(vm_['name']),
        args=__utils__['cloud.filter_event'](
Severity: Major
Found in salt/cloud/clouds/azurearm.py and 37 other locations - About 2 hrs to fix
salt/cloud/clouds/aliyun.py on lines 625..631
salt/cloud/clouds/aliyun.py on lines 732..738
salt/cloud/clouds/azurearm.py on lines 1349..1359
salt/cloud/clouds/azurearm.py on lines 1480..1489
salt/cloud/clouds/digitalocean.py on lines 287..293
salt/cloud/clouds/digitalocean.py on lines 537..543
salt/cloud/clouds/dimensiondata.py on lines 207..213
salt/cloud/clouds/dimensiondata.py on lines 337..343
salt/cloud/clouds/ec2.py on lines 2579..2585
salt/cloud/clouds/gce.py on lines 2461..2467
salt/cloud/clouds/gce.py on lines 2551..2557
salt/cloud/clouds/gce.py on lines 2635..2641
salt/cloud/clouds/gogrid.py on lines 96..102
salt/cloud/clouds/gogrid.py on lines 180..186
salt/cloud/clouds/joyent.py on lines 274..280
salt/cloud/clouds/joyent.py on lines 325..331
salt/cloud/clouds/lxc.py on lines 440..446
salt/cloud/clouds/lxc.py on lines 460..466
salt/cloud/clouds/lxc.py on lines 488..494
salt/cloud/clouds/msazure.py on lines 429..435
salt/cloud/clouds/msazure.py on lines 683..689
salt/cloud/clouds/nova.py on lines 961..967
salt/cloud/clouds/opennebula.py on lines 1006..1012
salt/cloud/clouds/openstack.py on lines 684..690
salt/cloud/clouds/packet.py on lines 347..353
salt/cloud/clouds/parallels.py on lines 287..293
salt/cloud/clouds/parallels.py on lines 356..362
salt/cloud/clouds/proxmox.py on lines 578..585
salt/cloud/clouds/qingcloud.py on lines 668..674
salt/cloud/clouds/qingcloud.py on lines 738..744
salt/cloud/clouds/scaleway.py on lines 200..206
salt/cloud/clouds/scaleway.py on lines 304..310
salt/cloud/clouds/virtualbox.py on lines 176..182
salt/cloud/clouds/vmware.py on lines 2543..2549
salt/cloud/clouds/vmware.py on lines 3072..3078
salt/cloud/clouds/vultrpy.py on lines 292..298
salt/cloud/clouds/vultrpy.py on lines 465..471

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

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

    __utils__['cloud.fire_event'](
        'event',
        'starting create',
        'salt/cloud/{0}/creating'.format(vm_['name']),
        args=__utils__['cloud.filter_event']('creating', vm_, ['name', 'profile', 'provider', 'driver']),
Severity: Major
Found in salt/cloud/clouds/gogrid.py and 37 other locations - About 2 hrs to fix
salt/cloud/clouds/aliyun.py on lines 625..631
salt/cloud/clouds/aliyun.py on lines 732..738
salt/cloud/clouds/azurearm.py on lines 1349..1359
salt/cloud/clouds/azurearm.py on lines 1398..1406
salt/cloud/clouds/azurearm.py on lines 1480..1489
salt/cloud/clouds/digitalocean.py on lines 287..293
salt/cloud/clouds/digitalocean.py on lines 537..543
salt/cloud/clouds/dimensiondata.py on lines 207..213
salt/cloud/clouds/dimensiondata.py on lines 337..343
salt/cloud/clouds/ec2.py on lines 2579..2585
salt/cloud/clouds/gce.py on lines 2461..2467
salt/cloud/clouds/gce.py on lines 2551..2557
salt/cloud/clouds/gce.py on lines 2635..2641
salt/cloud/clouds/gogrid.py on lines 180..186
salt/cloud/clouds/joyent.py on lines 274..280
salt/cloud/clouds/joyent.py on lines 325..331
salt/cloud/clouds/lxc.py on lines 440..446
salt/cloud/clouds/lxc.py on lines 460..466
salt/cloud/clouds/lxc.py on lines 488..494
salt/cloud/clouds/msazure.py on lines 429..435
salt/cloud/clouds/msazure.py on lines 683..689
salt/cloud/clouds/nova.py on lines 961..967
salt/cloud/clouds/opennebula.py on lines 1006..1012
salt/cloud/clouds/openstack.py on lines 684..690
salt/cloud/clouds/packet.py on lines 347..353
salt/cloud/clouds/parallels.py on lines 287..293
salt/cloud/clouds/parallels.py on lines 356..362
salt/cloud/clouds/proxmox.py on lines 578..585
salt/cloud/clouds/qingcloud.py on lines 668..674
salt/cloud/clouds/qingcloud.py on lines 738..744
salt/cloud/clouds/scaleway.py on lines 200..206
salt/cloud/clouds/scaleway.py on lines 304..310
salt/cloud/clouds/virtualbox.py on lines 176..182
salt/cloud/clouds/vmware.py on lines 2543..2549
salt/cloud/clouds/vmware.py on lines 3072..3078
salt/cloud/clouds/vultrpy.py on lines 292..298
salt/cloud/clouds/vultrpy.py on lines 465..471

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

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

    __utils__['cloud.fire_event'](
        'event',
        'starting create',
        'salt/cloud/{0}/creating'.format(vm_['name']),
        args=__utils__['cloud.filter_event']('creating', vm_, ['name', 'profile', 'provider', 'driver']),
Severity: Major
Found in salt/cloud/clouds/digitalocean.py and 37 other locations - About 2 hrs to fix
salt/cloud/clouds/aliyun.py on lines 625..631
salt/cloud/clouds/aliyun.py on lines 732..738
salt/cloud/clouds/azurearm.py on lines 1349..1359
salt/cloud/clouds/azurearm.py on lines 1398..1406
salt/cloud/clouds/azurearm.py on lines 1480..1489
salt/cloud/clouds/digitalocean.py on lines 537..543
salt/cloud/clouds/dimensiondata.py on lines 207..213
salt/cloud/clouds/dimensiondata.py on lines 337..343
salt/cloud/clouds/ec2.py on lines 2579..2585
salt/cloud/clouds/gce.py on lines 2461..2467
salt/cloud/clouds/gce.py on lines 2551..2557
salt/cloud/clouds/gce.py on lines 2635..2641
salt/cloud/clouds/gogrid.py on lines 96..102
salt/cloud/clouds/gogrid.py on lines 180..186
salt/cloud/clouds/joyent.py on lines 274..280
salt/cloud/clouds/joyent.py on lines 325..331
salt/cloud/clouds/lxc.py on lines 440..446
salt/cloud/clouds/lxc.py on lines 460..466
salt/cloud/clouds/lxc.py on lines 488..494
salt/cloud/clouds/msazure.py on lines 429..435
salt/cloud/clouds/msazure.py on lines 683..689
salt/cloud/clouds/nova.py on lines 961..967
salt/cloud/clouds/opennebula.py on lines 1006..1012
salt/cloud/clouds/openstack.py on lines 684..690
salt/cloud/clouds/packet.py on lines 347..353
salt/cloud/clouds/parallels.py on lines 287..293
salt/cloud/clouds/parallels.py on lines 356..362
salt/cloud/clouds/proxmox.py on lines 578..585
salt/cloud/clouds/qingcloud.py on lines 668..674
salt/cloud/clouds/qingcloud.py on lines 738..744
salt/cloud/clouds/scaleway.py on lines 200..206
salt/cloud/clouds/scaleway.py on lines 304..310
salt/cloud/clouds/virtualbox.py on lines 176..182
salt/cloud/clouds/vmware.py on lines 2543..2549
salt/cloud/clouds/vmware.py on lines 3072..3078
salt/cloud/clouds/vultrpy.py on lines 292..298
salt/cloud/clouds/vultrpy.py on lines 465..471

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

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

    __utils__['cloud.fire_event'](
        'event',
        'created instance',
        'salt/cloud/{0}/created'.format(server_['name']),
        args=__utils__['cloud.filter_event']('created', server_, ['name', 'profile', 'provider', 'driver']),
Severity: Major
Found in salt/cloud/clouds/scaleway.py and 37 other locations - About 2 hrs to fix
salt/cloud/clouds/aliyun.py on lines 625..631
salt/cloud/clouds/aliyun.py on lines 732..738
salt/cloud/clouds/azurearm.py on lines 1349..1359
salt/cloud/clouds/azurearm.py on lines 1398..1406
salt/cloud/clouds/azurearm.py on lines 1480..1489
salt/cloud/clouds/digitalocean.py on lines 287..293
salt/cloud/clouds/digitalocean.py on lines 537..543
salt/cloud/clouds/dimensiondata.py on lines 207..213
salt/cloud/clouds/dimensiondata.py on lines 337..343
salt/cloud/clouds/ec2.py on lines 2579..2585
salt/cloud/clouds/gce.py on lines 2461..2467
salt/cloud/clouds/gce.py on lines 2551..2557
salt/cloud/clouds/gce.py on lines 2635..2641
salt/cloud/clouds/gogrid.py on lines 96..102
salt/cloud/clouds/gogrid.py on lines 180..186
salt/cloud/clouds/joyent.py on lines 274..280
salt/cloud/clouds/joyent.py on lines 325..331
salt/cloud/clouds/lxc.py on lines 440..446
salt/cloud/clouds/lxc.py on lines 460..466
salt/cloud/clouds/lxc.py on lines 488..494
salt/cloud/clouds/msazure.py on lines 429..435
salt/cloud/clouds/msazure.py on lines 683..689
salt/cloud/clouds/nova.py on lines 961..967
salt/cloud/clouds/opennebula.py on lines 1006..1012
salt/cloud/clouds/openstack.py on lines 684..690
salt/cloud/clouds/packet.py on lines 347..353
salt/cloud/clouds/parallels.py on lines 287..293
salt/cloud/clouds/parallels.py on lines 356..362
salt/cloud/clouds/proxmox.py on lines 578..585
salt/cloud/clouds/qingcloud.py on lines 668..674
salt/cloud/clouds/qingcloud.py on lines 738..744
salt/cloud/clouds/scaleway.py on lines 200..206
salt/cloud/clouds/virtualbox.py on lines 176..182
salt/cloud/clouds/vmware.py on lines 2543..2549
salt/cloud/clouds/vmware.py on lines 3072..3078
salt/cloud/clouds/vultrpy.py on lines 292..298
salt/cloud/clouds/vultrpy.py on lines 465..471

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

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

    __utils__['cloud.fire_event'](
        'event',
        'created instance',
        'salt/cloud/{0}/created'.format(vm_['name']),
        args=__utils__['cloud.filter_event']('created', vm_, ['name', 'profile', 'provider', 'driver']),
Severity: Major
Found in salt/cloud/clouds/msazure.py and 37 other locations - About 2 hrs to fix
salt/cloud/clouds/aliyun.py on lines 625..631
salt/cloud/clouds/aliyun.py on lines 732..738
salt/cloud/clouds/azurearm.py on lines 1349..1359
salt/cloud/clouds/azurearm.py on lines 1398..1406
salt/cloud/clouds/azurearm.py on lines 1480..1489
salt/cloud/clouds/digitalocean.py on lines 287..293
salt/cloud/clouds/digitalocean.py on lines 537..543
salt/cloud/clouds/dimensiondata.py on lines 207..213
salt/cloud/clouds/dimensiondata.py on lines 337..343
salt/cloud/clouds/ec2.py on lines 2579..2585
salt/cloud/clouds/gce.py on lines 2461..2467
salt/cloud/clouds/gce.py on lines 2551..2557
salt/cloud/clouds/gce.py on lines 2635..2641
salt/cloud/clouds/gogrid.py on lines 96..102
salt/cloud/clouds/gogrid.py on lines 180..186
salt/cloud/clouds/joyent.py on lines 274..280
salt/cloud/clouds/joyent.py on lines 325..331
salt/cloud/clouds/lxc.py on lines 440..446
salt/cloud/clouds/lxc.py on lines 460..466
salt/cloud/clouds/lxc.py on lines 488..494
salt/cloud/clouds/msazure.py on lines 429..435
salt/cloud/clouds/nova.py on lines 961..967
salt/cloud/clouds/opennebula.py on lines 1006..1012
salt/cloud/clouds/openstack.py on lines 684..690
salt/cloud/clouds/packet.py on lines 347..353
salt/cloud/clouds/parallels.py on lines 287..293
salt/cloud/clouds/parallels.py on lines 356..362
salt/cloud/clouds/proxmox.py on lines 578..585
salt/cloud/clouds/qingcloud.py on lines 668..674
salt/cloud/clouds/qingcloud.py on lines 738..744
salt/cloud/clouds/scaleway.py on lines 200..206
salt/cloud/clouds/scaleway.py on lines 304..310
salt/cloud/clouds/virtualbox.py on lines 176..182
salt/cloud/clouds/vmware.py on lines 2543..2549
salt/cloud/clouds/vmware.py on lines 3072..3078
salt/cloud/clouds/vultrpy.py on lines 292..298
salt/cloud/clouds/vultrpy.py on lines 465..471

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

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

    __utils__['cloud.fire_event'](
        'event',
        'starting create',
        'salt/cloud/{0}/creating'.format(vm_['name']),
        args=__utils__['cloud.filter_event'](
Severity: Major
Found in salt/cloud/clouds/proxmox.py and 37 other locations - About 2 hrs to fix
salt/cloud/clouds/aliyun.py on lines 625..631
salt/cloud/clouds/aliyun.py on lines 732..738
salt/cloud/clouds/azurearm.py on lines 1349..1359
salt/cloud/clouds/azurearm.py on lines 1398..1406
salt/cloud/clouds/azurearm.py on lines 1480..1489
salt/cloud/clouds/digitalocean.py on lines 287..293
salt/cloud/clouds/digitalocean.py on lines 537..543
salt/cloud/clouds/dimensiondata.py on lines 207..213
salt/cloud/clouds/dimensiondata.py on lines 337..343
salt/cloud/clouds/ec2.py on lines 2579..2585
salt/cloud/clouds/gce.py on lines 2461..2467
salt/cloud/clouds/gce.py on lines 2551..2557
salt/cloud/clouds/gce.py on lines 2635..2641
salt/cloud/clouds/gogrid.py on lines 96..102
salt/cloud/clouds/gogrid.py on lines 180..186
salt/cloud/clouds/joyent.py on lines 274..280
salt/cloud/clouds/joyent.py on lines 325..331
salt/cloud/clouds/lxc.py on lines 440..446
salt/cloud/clouds/lxc.py on lines 460..466
salt/cloud/clouds/lxc.py on lines 488..494
salt/cloud/clouds/msazure.py on lines 429..435
salt/cloud/clouds/msazure.py on lines 683..689
salt/cloud/clouds/nova.py on lines 961..967
salt/cloud/clouds/opennebula.py on lines 1006..1012
salt/cloud/clouds/openstack.py on lines 684..690
salt/cloud/clouds/packet.py on lines 347..353
salt/cloud/clouds/parallels.py on lines 287..293
salt/cloud/clouds/parallels.py on lines 356..362
salt/cloud/clouds/qingcloud.py on lines 668..674
salt/cloud/clouds/qingcloud.py on lines 738..744
salt/cloud/clouds/scaleway.py on lines 200..206
salt/cloud/clouds/scaleway.py on lines 304..310
salt/cloud/clouds/virtualbox.py on lines 176..182
salt/cloud/clouds/vmware.py on lines 2543..2549
salt/cloud/clouds/vmware.py on lines 3072..3078
salt/cloud/clouds/vultrpy.py on lines 292..298
salt/cloud/clouds/vultrpy.py on lines 465..471

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

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

    __utils__['cloud.fire_event'](
        'event',
        'created instance',
        'salt/cloud/{0}/created'.format(vm_['name']),
        args=__utils__['cloud.filter_event'](
Severity: Major
Found in salt/cloud/clouds/azurearm.py and 37 other locations - About 2 hrs to fix
salt/cloud/clouds/aliyun.py on lines 625..631
salt/cloud/clouds/aliyun.py on lines 732..738
salt/cloud/clouds/azurearm.py on lines 1349..1359
salt/cloud/clouds/azurearm.py on lines 1398..1406
salt/cloud/clouds/digitalocean.py on lines 287..293
salt/cloud/clouds/digitalocean.py on lines 537..543
salt/cloud/clouds/dimensiondata.py on lines 207..213
salt/cloud/clouds/dimensiondata.py on lines 337..343
salt/cloud/clouds/ec2.py on lines 2579..2585
salt/cloud/clouds/gce.py on lines 2461..2467
salt/cloud/clouds/gce.py on lines 2551..2557
salt/cloud/clouds/gce.py on lines 2635..2641
salt/cloud/clouds/gogrid.py on lines 96..102
salt/cloud/clouds/gogrid.py on lines 180..186
salt/cloud/clouds/joyent.py on lines 274..280
salt/cloud/clouds/joyent.py on lines 325..331
salt/cloud/clouds/lxc.py on lines 440..446
salt/cloud/clouds/lxc.py on lines 460..466
salt/cloud/clouds/lxc.py on lines 488..494
salt/cloud/clouds/msazure.py on lines 429..435
salt/cloud/clouds/msazure.py on lines 683..689
salt/cloud/clouds/nova.py on lines 961..967
salt/cloud/clouds/opennebula.py on lines 1006..1012
salt/cloud/clouds/openstack.py on lines 684..690
salt/cloud/clouds/packet.py on lines 347..353
salt/cloud/clouds/parallels.py on lines 287..293
salt/cloud/clouds/parallels.py on lines 356..362
salt/cloud/clouds/proxmox.py on lines 578..585
salt/cloud/clouds/qingcloud.py on lines 668..674
salt/cloud/clouds/qingcloud.py on lines 738..744
salt/cloud/clouds/scaleway.py on lines 200..206
salt/cloud/clouds/scaleway.py on lines 304..310
salt/cloud/clouds/virtualbox.py on lines 176..182
salt/cloud/clouds/vmware.py on lines 2543..2549
salt/cloud/clouds/vmware.py on lines 3072..3078
salt/cloud/clouds/vultrpy.py on lines 292..298
salt/cloud/clouds/vultrpy.py on lines 465..471

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

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

    __utils__['cloud.fire_event'](
        'event',
        'requesting instance',
        'salt/cloud/{0}/requesting'.format(vm_['name']),
        args=__utils__['cloud.filter_event']('requesting', vm_, ['name', 'profile', 'provider', 'driver']),
Severity: Major
Found in salt/cloud/clouds/lxc.py and 37 other locations - About 2 hrs to fix
salt/cloud/clouds/aliyun.py on lines 625..631
salt/cloud/clouds/aliyun.py on lines 732..738
salt/cloud/clouds/azurearm.py on lines 1349..1359
salt/cloud/clouds/azurearm.py on lines 1398..1406
salt/cloud/clouds/azurearm.py on lines 1480..1489
salt/cloud/clouds/digitalocean.py on lines 287..293
salt/cloud/clouds/digitalocean.py on lines 537..543
salt/cloud/clouds/dimensiondata.py on lines 207..213
salt/cloud/clouds/dimensiondata.py on lines 337..343
salt/cloud/clouds/ec2.py on lines 2579..2585
salt/cloud/clouds/gce.py on lines 2461..2467
salt/cloud/clouds/gce.py on lines 2551..2557
salt/cloud/clouds/gce.py on lines 2635..2641
salt/cloud/clouds/gogrid.py on lines 96..102
salt/cloud/clouds/gogrid.py on lines 180..186
salt/cloud/clouds/joyent.py on lines 274..280
salt/cloud/clouds/joyent.py on lines 325..331
salt/cloud/clouds/lxc.py on lines 440..446
salt/cloud/clouds/lxc.py on lines 488..494
salt/cloud/clouds/msazure.py on lines 429..435
salt/cloud/clouds/msazure.py on lines 683..689
salt/cloud/clouds/nova.py on lines 961..967
salt/cloud/clouds/opennebula.py on lines 1006..1012
salt/cloud/clouds/openstack.py on lines 684..690
salt/cloud/clouds/packet.py on lines 347..353
salt/cloud/clouds/parallels.py on lines 287..293
salt/cloud/clouds/parallels.py on lines 356..362
salt/cloud/clouds/proxmox.py on lines 578..585
salt/cloud/clouds/qingcloud.py on lines 668..674
salt/cloud/clouds/qingcloud.py on lines 738..744
salt/cloud/clouds/scaleway.py on lines 200..206
salt/cloud/clouds/scaleway.py on lines 304..310
salt/cloud/clouds/virtualbox.py on lines 176..182
salt/cloud/clouds/vmware.py on lines 2543..2549
salt/cloud/clouds/vmware.py on lines 3072..3078
salt/cloud/clouds/vultrpy.py on lines 292..298
salt/cloud/clouds/vultrpy.py on lines 465..471

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

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

    __utils__['cloud.fire_event'](
        'event',
        'starting create',
        'salt/cloud/{0}/creating'.format(vm_['name']),
        args=__utils__['cloud.filter_event']('creating', vm_, ['name', 'profile', 'provider', 'driver']),
Severity: Major
Found in salt/cloud/clouds/ec2.py and 37 other locations - About 2 hrs to fix
salt/cloud/clouds/aliyun.py on lines 625..631
salt/cloud/clouds/aliyun.py on lines 732..738
salt/cloud/clouds/azurearm.py on lines 1349..1359
salt/cloud/clouds/azurearm.py on lines 1398..1406
salt/cloud/clouds/azurearm.py on lines 1480..1489
salt/cloud/clouds/digitalocean.py on lines 287..293
salt/cloud/clouds/digitalocean.py on lines 537..543
salt/cloud/clouds/dimensiondata.py on lines 207..213
salt/cloud/clouds/dimensiondata.py on lines 337..343
salt/cloud/clouds/gce.py on lines 2461..2467
salt/cloud/clouds/gce.py on lines 2551..2557
salt/cloud/clouds/gce.py on lines 2635..2641
salt/cloud/clouds/gogrid.py on lines 96..102
salt/cloud/clouds/gogrid.py on lines 180..186
salt/cloud/clouds/joyent.py on lines 274..280
salt/cloud/clouds/joyent.py on lines 325..331
salt/cloud/clouds/lxc.py on lines 440..446
salt/cloud/clouds/lxc.py on lines 460..466
salt/cloud/clouds/lxc.py on lines 488..494
salt/cloud/clouds/msazure.py on lines 429..435
salt/cloud/clouds/msazure.py on lines 683..689
salt/cloud/clouds/nova.py on lines 961..967
salt/cloud/clouds/opennebula.py on lines 1006..1012
salt/cloud/clouds/openstack.py on lines 684..690
salt/cloud/clouds/packet.py on lines 347..353
salt/cloud/clouds/parallels.py on lines 287..293
salt/cloud/clouds/parallels.py on lines 356..362
salt/cloud/clouds/proxmox.py on lines 578..585
salt/cloud/clouds/qingcloud.py on lines 668..674
salt/cloud/clouds/qingcloud.py on lines 738..744
salt/cloud/clouds/scaleway.py on lines 200..206
salt/cloud/clouds/scaleway.py on lines 304..310
salt/cloud/clouds/virtualbox.py on lines 176..182
salt/cloud/clouds/vmware.py on lines 2543..2549
salt/cloud/clouds/vmware.py on lines 3072..3078
salt/cloud/clouds/vultrpy.py on lines 292..298
salt/cloud/clouds/vultrpy.py on lines 465..471

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

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

    __utils__['cloud.fire_event'](
        'event',
        'starting create',
        'salt/cloud/{0}/creating'.format(server_['name']),
        args=__utils__['cloud.filter_event']('creating', server_, ['name', 'profile', 'provider', 'driver']),
Severity: Major
Found in salt/cloud/clouds/scaleway.py and 37 other locations - About 2 hrs to fix
salt/cloud/clouds/aliyun.py on lines 625..631
salt/cloud/clouds/aliyun.py on lines 732..738
salt/cloud/clouds/azurearm.py on lines 1349..1359
salt/cloud/clouds/azurearm.py on lines 1398..1406
salt/cloud/clouds/azurearm.py on lines 1480..1489
salt/cloud/clouds/digitalocean.py on lines 287..293
salt/cloud/clouds/digitalocean.py on lines 537..543
salt/cloud/clouds/dimensiondata.py on lines 207..213
salt/cloud/clouds/dimensiondata.py on lines 337..343
salt/cloud/clouds/ec2.py on lines 2579..2585
salt/cloud/clouds/gce.py on lines 2461..2467
salt/cloud/clouds/gce.py on lines 2551..2557
salt/cloud/clouds/gce.py on lines 2635..2641
salt/cloud/clouds/gogrid.py on lines 96..102
salt/cloud/clouds/gogrid.py on lines 180..186
salt/cloud/clouds/joyent.py on lines 274..280
salt/cloud/clouds/joyent.py on lines 325..331
salt/cloud/clouds/lxc.py on lines 440..446
salt/cloud/clouds/lxc.py on lines 460..466
salt/cloud/clouds/lxc.py on lines 488..494
salt/cloud/clouds/msazure.py on lines 429..435
salt/cloud/clouds/msazure.py on lines 683..689
salt/cloud/clouds/nova.py on lines 961..967
salt/cloud/clouds/opennebula.py on lines 1006..1012
salt/cloud/clouds/openstack.py on lines 684..690
salt/cloud/clouds/packet.py on lines 347..353
salt/cloud/clouds/parallels.py on lines 287..293
salt/cloud/clouds/parallels.py on lines 356..362
salt/cloud/clouds/proxmox.py on lines 578..585
salt/cloud/clouds/qingcloud.py on lines 668..674
salt/cloud/clouds/qingcloud.py on lines 738..744
salt/cloud/clouds/scaleway.py on lines 304..310
salt/cloud/clouds/virtualbox.py on lines 176..182
salt/cloud/clouds/vmware.py on lines 2543..2549
salt/cloud/clouds/vmware.py on lines 3072..3078
salt/cloud/clouds/vultrpy.py on lines 292..298
salt/cloud/clouds/vultrpy.py on lines 465..471

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

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

    __utils__['cloud.fire_event'](
        'event',
        'created instance',
        'salt/cloud/{0}/created'.format(vm_['name']),
        args=__utils__['cloud.filter_event']('created', vm_, ['name', 'profile', 'provider', 'driver']),
Severity: Major
Found in salt/cloud/clouds/gce.py and 37 other locations - About 2 hrs to fix
salt/cloud/clouds/aliyun.py on lines 625..631
salt/cloud/clouds/aliyun.py on lines 732..738
salt/cloud/clouds/azurearm.py on lines 1349..1359
salt/cloud/clouds/azurearm.py on lines 1398..1406
salt/cloud/clouds/azurearm.py on lines 1480..1489
salt/cloud/clouds/digitalocean.py on lines 287..293
salt/cloud/clouds/digitalocean.py on lines 537..543
salt/cloud/clouds/dimensiondata.py on lines 207..213
salt/cloud/clouds/dimensiondata.py on lines 337..343
salt/cloud/clouds/ec2.py on lines 2579..2585
salt/cloud/clouds/gce.py on lines 2461..2467
salt/cloud/clouds/gce.py on lines 2551..2557
salt/cloud/clouds/gogrid.py on lines 96..102
salt/cloud/clouds/gogrid.py on lines 180..186
salt/cloud/clouds/joyent.py on lines 274..280
salt/cloud/clouds/joyent.py on lines 325..331
salt/cloud/clouds/lxc.py on lines 440..446
salt/cloud/clouds/lxc.py on lines 460..466
salt/cloud/clouds/lxc.py on lines 488..494
salt/cloud/clouds/msazure.py on lines 429..435
salt/cloud/clouds/msazure.py on lines 683..689
salt/cloud/clouds/nova.py on lines 961..967
salt/cloud/clouds/opennebula.py on lines 1006..1012
salt/cloud/clouds/openstack.py on lines 684..690
salt/cloud/clouds/packet.py on lines 347..353
salt/cloud/clouds/parallels.py on lines 287..293
salt/cloud/clouds/parallels.py on lines 356..362
salt/cloud/clouds/proxmox.py on lines 578..585
salt/cloud/clouds/qingcloud.py on lines 668..674
salt/cloud/clouds/qingcloud.py on lines 738..744
salt/cloud/clouds/scaleway.py on lines 200..206
salt/cloud/clouds/scaleway.py on lines 304..310
salt/cloud/clouds/virtualbox.py on lines 176..182
salt/cloud/clouds/vmware.py on lines 2543..2549
salt/cloud/clouds/vmware.py on lines 3072..3078
salt/cloud/clouds/vultrpy.py on lines 292..298
salt/cloud/clouds/vultrpy.py on lines 465..471

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

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

    __utils__['cloud.fire_event'](
        'event',
        'starting create',
        'salt/cloud/{0}/creating'.format(vm_['name']),
        args=__utils__['cloud.filter_event']('creating', event_data, ['name', 'profile', 'provider', 'driver']),
Severity: Major
Found in salt/cloud/clouds/lxc.py and 37 other locations - About 2 hrs to fix
salt/cloud/clouds/aliyun.py on lines 625..631
salt/cloud/clouds/aliyun.py on lines 732..738
salt/cloud/clouds/azurearm.py on lines 1349..1359
salt/cloud/clouds/azurearm.py on lines 1398..1406
salt/cloud/clouds/azurearm.py on lines 1480..1489
salt/cloud/clouds/digitalocean.py on lines 287..293
salt/cloud/clouds/digitalocean.py on lines 537..543
salt/cloud/clouds/dimensiondata.py on lines 207..213
salt/cloud/clouds/dimensiondata.py on lines 337..343
salt/cloud/clouds/ec2.py on lines 2579..2585
salt/cloud/clouds/gce.py on lines 2461..2467
salt/cloud/clouds/gce.py on lines 2551..2557
salt/cloud/clouds/gce.py on lines 2635..2641
salt/cloud/clouds/gogrid.py on lines 96..102
salt/cloud/clouds/gogrid.py on lines 180..186
salt/cloud/clouds/joyent.py on lines 274..280
salt/cloud/clouds/joyent.py on lines 325..331
salt/cloud/clouds/lxc.py on lines 460..466
salt/cloud/clouds/lxc.py on lines 488..494
salt/cloud/clouds/msazure.py on lines 429..435
salt/cloud/clouds/msazure.py on lines 683..689
salt/cloud/clouds/nova.py on lines 961..967
salt/cloud/clouds/opennebula.py on lines 1006..1012
salt/cloud/clouds/openstack.py on lines 684..690
salt/cloud/clouds/packet.py on lines 347..353
salt/cloud/clouds/parallels.py on lines 287..293
salt/cloud/clouds/parallels.py on lines 356..362
salt/cloud/clouds/proxmox.py on lines 578..585
salt/cloud/clouds/qingcloud.py on lines 668..674
salt/cloud/clouds/qingcloud.py on lines 738..744
salt/cloud/clouds/scaleway.py on lines 200..206
salt/cloud/clouds/scaleway.py on lines 304..310
salt/cloud/clouds/virtualbox.py on lines 176..182
salt/cloud/clouds/vmware.py on lines 2543..2549
salt/cloud/clouds/vmware.py on lines 3072..3078
salt/cloud/clouds/vultrpy.py on lines 292..298
salt/cloud/clouds/vultrpy.py on lines 465..471

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

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

    __utils__['cloud.fire_event'](
        'event',
        'starting create',
        'salt/cloud/{0}/creating'.format(vm_['name']),
        args=__utils__['cloud.filter_event']('creating', vm_, ['name', 'profile', 'provider', 'driver']),
Severity: Major
Found in salt/cloud/clouds/qingcloud.py and 37 other locations - About 2 hrs to fix
salt/cloud/clouds/aliyun.py on lines 625..631
salt/cloud/clouds/aliyun.py on lines 732..738
salt/cloud/clouds/azurearm.py on lines 1349..1359
salt/cloud/clouds/azurearm.py on lines 1398..1406
salt/cloud/clouds/azurearm.py on lines 1480..1489
salt/cloud/clouds/digitalocean.py on lines 287..293
salt/cloud/clouds/digitalocean.py on lines 537..543
salt/cloud/clouds/dimensiondata.py on lines 207..213
salt/cloud/clouds/dimensiondata.py on lines 337..343
salt/cloud/clouds/ec2.py on lines 2579..2585
salt/cloud/clouds/gce.py on lines 2461..2467
salt/cloud/clouds/gce.py on lines 2551..2557
salt/cloud/clouds/gce.py on lines 2635..2641
salt/cloud/clouds/gogrid.py on lines 96..102
salt/cloud/clouds/gogrid.py on lines 180..186
salt/cloud/clouds/joyent.py on lines 274..280
salt/cloud/clouds/joyent.py on lines 325..331
salt/cloud/clouds/lxc.py on lines 440..446
salt/cloud/clouds/lxc.py on lines 460..466
salt/cloud/clouds/lxc.py on lines 488..494
salt/cloud/clouds/msazure.py on lines 429..435
salt/cloud/clouds/msazure.py on lines 683..689
salt/cloud/clouds/nova.py on lines 961..967
salt/cloud/clouds/opennebula.py on lines 1006..1012
salt/cloud/clouds/openstack.py on lines 684..690
salt/cloud/clouds/packet.py on lines 347..353
salt/cloud/clouds/parallels.py on lines 287..293
salt/cloud/clouds/parallels.py on lines 356..362
salt/cloud/clouds/proxmox.py on lines 578..585
salt/cloud/clouds/qingcloud.py on lines 738..744
salt/cloud/clouds/scaleway.py on lines 200..206
salt/cloud/clouds/scaleway.py on lines 304..310
salt/cloud/clouds/virtualbox.py on lines 176..182
salt/cloud/clouds/vmware.py on lines 2543..2549
salt/cloud/clouds/vmware.py on lines 3072..3078
salt/cloud/clouds/vultrpy.py on lines 292..298
salt/cloud/clouds/vultrpy.py on lines 465..471

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

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

    __utils__['cloud.fire_event'](
        'event',
        'starting create',
        'salt/cloud/{0}/creating'.format(vm_['name']),
        args=__utils__['cloud.filter_event']('creating', vm_, ['name', 'profile', 'provider', 'driver']),
Severity: Major
Found in salt/cloud/clouds/joyent.py and 37 other locations - About 2 hrs to fix
salt/cloud/clouds/aliyun.py on lines 625..631
salt/cloud/clouds/aliyun.py on lines 732..738
salt/cloud/clouds/azurearm.py on lines 1349..1359
salt/cloud/clouds/azurearm.py on lines 1398..1406
salt/cloud/clouds/azurearm.py on lines 1480..1489
salt/cloud/clouds/digitalocean.py on lines 287..293
salt/cloud/clouds/digitalocean.py on lines 537..543
salt/cloud/clouds/dimensiondata.py on lines 207..213
salt/cloud/clouds/dimensiondata.py on lines 337..343
salt/cloud/clouds/ec2.py on lines 2579..2585
salt/cloud/clouds/gce.py on lines 2461..2467
salt/cloud/clouds/gce.py on lines 2551..2557
salt/cloud/clouds/gce.py on lines 2635..2641
salt/cloud/clouds/gogrid.py on lines 96..102
salt/cloud/clouds/gogrid.py on lines 180..186
salt/cloud/clouds/joyent.py on lines 325..331
salt/cloud/clouds/lxc.py on lines 440..446
salt/cloud/clouds/lxc.py on lines 460..466
salt/cloud/clouds/lxc.py on lines 488..494
salt/cloud/clouds/msazure.py on lines 429..435
salt/cloud/clouds/msazure.py on lines 683..689
salt/cloud/clouds/nova.py on lines 961..967
salt/cloud/clouds/opennebula.py on lines 1006..1012
salt/cloud/clouds/openstack.py on lines 684..690
salt/cloud/clouds/packet.py on lines 347..353
salt/cloud/clouds/parallels.py on lines 287..293
salt/cloud/clouds/parallels.py on lines 356..362
salt/cloud/clouds/proxmox.py on lines 578..585
salt/cloud/clouds/qingcloud.py on lines 668..674
salt/cloud/clouds/qingcloud.py on lines 738..744
salt/cloud/clouds/scaleway.py on lines 200..206
salt/cloud/clouds/scaleway.py on lines 304..310
salt/cloud/clouds/virtualbox.py on lines 176..182
salt/cloud/clouds/vmware.py on lines 2543..2549
salt/cloud/clouds/vmware.py on lines 3072..3078
salt/cloud/clouds/vultrpy.py on lines 292..298
salt/cloud/clouds/vultrpy.py on lines 465..471

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

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

    if not _numeric(kwargs['mean']) or not -1000000 <= kwargs['mean'] <= 1000000:
        ret['res'] = False
        ret['message'] = "The distribution's mean must be between -1000000 and 1000000"
        return ret
Severity: Major
Found in salt/modules/random_org.py and 11 other locations - About 2 hrs to fix
salt/modules/random_org.py on lines 237..240
salt/modules/random_org.py on lines 242..245
salt/modules/random_org.py on lines 247..250
salt/modules/random_org.py on lines 352..355
salt/modules/random_org.py on lines 357..360
salt/modules/random_org.py on lines 444..447
salt/modules/random_org.py on lines 528..531
salt/modules/random_org.py on lines 614..617
salt/modules/random_org.py on lines 624..627
salt/modules/random_org.py on lines 629..632
salt/modules/random_org.py on lines 705..708

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

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

    if not _numeric(kwargs['number']) or not 1 <= kwargs['number'] <= 10000:
        ret['res'] = False
        ret['message'] = 'Number of strings must be between 1 and 10000'
        return ret
Severity: Major
Found in salt/modules/random_org.py and 11 other locations - About 2 hrs to fix
salt/modules/random_org.py on lines 237..240
salt/modules/random_org.py on lines 242..245
salt/modules/random_org.py on lines 247..250
salt/modules/random_org.py on lines 357..360
salt/modules/random_org.py on lines 444..447
salt/modules/random_org.py on lines 528..531
salt/modules/random_org.py on lines 614..617
salt/modules/random_org.py on lines 619..622
salt/modules/random_org.py on lines 624..627
salt/modules/random_org.py on lines 629..632
salt/modules/random_org.py on lines 705..708

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

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

    if not _numeric(kwargs['decimalPlaces']) or not 1 <= kwargs['decimalPlaces'] <= 20:
        ret['res'] = False
        ret['message'] = 'Number of decimal places must be between 1 and 20'
        return ret
Severity: Major
Found in salt/modules/random_org.py and 11 other locations - About 2 hrs to fix
salt/modules/random_org.py on lines 237..240
salt/modules/random_org.py on lines 242..245
salt/modules/random_org.py on lines 247..250
salt/modules/random_org.py on lines 352..355
salt/modules/random_org.py on lines 357..360
salt/modules/random_org.py on lines 444..447
salt/modules/random_org.py on lines 614..617
salt/modules/random_org.py on lines 619..622
salt/modules/random_org.py on lines 624..627
salt/modules/random_org.py on lines 629..632
salt/modules/random_org.py on lines 705..708

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

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

    if not _numeric(kwargs['minimum']) or not -1000000000 <= kwargs['minimum'] <= 1000000000:
        ret['res'] = False
        ret['message'] = 'Minimum argument must be between -1,000,000,000 and 1,000,000,000'
        return ret
Severity: Major
Found in salt/modules/random_org.py and 11 other locations - About 2 hrs to fix
salt/modules/random_org.py on lines 237..240
salt/modules/random_org.py on lines 247..250
salt/modules/random_org.py on lines 352..355
salt/modules/random_org.py on lines 357..360
salt/modules/random_org.py on lines 444..447
salt/modules/random_org.py on lines 528..531
salt/modules/random_org.py on lines 614..617
salt/modules/random_org.py on lines 619..622
salt/modules/random_org.py on lines 624..627
salt/modules/random_org.py on lines 629..632
salt/modules/random_org.py on lines 705..708

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

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

    if not _numeric(kwargs['number']) or not 1 <= kwargs['number'] <= 10000:
        ret['res'] = False
        ret['message'] = 'Number of decimal fractions must be between 1 and 10000'
        return ret
Severity: Major
Found in salt/modules/random_org.py and 11 other locations - About 2 hrs to fix
salt/modules/random_org.py on lines 237..240
salt/modules/random_org.py on lines 242..245
salt/modules/random_org.py on lines 247..250
salt/modules/random_org.py on lines 352..355
salt/modules/random_org.py on lines 357..360
salt/modules/random_org.py on lines 444..447
salt/modules/random_org.py on lines 528..531
salt/modules/random_org.py on lines 619..622
salt/modules/random_org.py on lines 624..627
salt/modules/random_org.py on lines 629..632
salt/modules/random_org.py on lines 705..708

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

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 vm_:
        info[vm_] = _info(_get_domain(conn, vm_))
    else:
        for domain in _get_domain(conn, iterable=True):
            info[domain.name()] = _info(domain)
Severity: Major
Found in salt/modules/virt.py and 3 other locations - About 2 hrs to fix
salt/modules/virt.py on lines 2194..2198
salt/modules/virt.py on lines 2237..2241
salt/modules/virt.py on lines 3805..3809

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

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