saltstack/salt

View on GitHub
salt/cloud/clouds/gce.py

Summary

Maintainability
F
3 wks
Test Coverage

File gce.py has 2185 lines of code (exceeds 250 allowed). Consider refactoring.
Open

# -*- coding: utf-8 -*-
'''
Copyright 2013 Google Inc. All Rights Reserved.

Licensed under the Apache License, Version 2.0 (the "License");
Severity: Major
Found in salt/cloud/clouds/gce.py - About 6 days to fix

    Function request_instance has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
    Open

    def request_instance(vm_):
        '''
        Request a single GCE instance from a data dict.
    
        .. versionchanged: 2017.7.0
    Severity: Minor
    Found in salt/cloud/clouds/gce.py - About 2 hrs to fix

    Cognitive Complexity

    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

    A method's cognitive complexity is based on a few simple rules:

    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
    • Code is considered more complex for each "break in the linear flow of the code"
    • Code is considered more complex when "flow breaking structures are nested"

    Further reading

    Function destroy has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
    Open

    def destroy(vm_name, call=None):
        '''
        Call 'destroy' on the instance.  Can be called with "-a destroy" or -d
    
        CLI Example:
    Severity: Minor
    Found in salt/cloud/clouds/gce.py - About 1 hr to fix

    Cognitive Complexity

    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

    A method's cognitive complexity is based on a few simple rules:

    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
    • Code is considered more complex for each "break in the linear flow of the code"
    • Code is considered more complex when "flow breaking structures are nested"

    Further reading

    Function _parse_allow has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
    Open

    def _parse_allow(allow):
        '''
        Convert firewall rule allowed user-string to specified REST API format.
        '''
        # input=> tcp:53,tcp:80,tcp:443,icmp,tcp:4201,udp:53
    Severity: Minor
    Found in salt/cloud/clouds/gce.py - About 1 hr to fix

    Cognitive Complexity

    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

    A method's cognitive complexity is based on a few simple rules:

    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
    • Code is considered more complex for each "break in the linear flow of the code"
    • Code is considered more complex when "flow breaking structures are nested"

    Further reading

    Function show_pricing has 29 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    def show_pricing(kwargs=None, call=None):
        '''
        Show pricing for a particular profile. This is only an estimate, based on
        unofficial pricing sources.
    
    
    Severity: Minor
    Found in salt/cloud/clouds/gce.py - About 1 hr to fix

      Function _expand_balancer has 28 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      def _expand_balancer(lb):
          '''
          Convert the libcloud load-balancer object into something more serializable.
          '''
          ret = {}
      Severity: Minor
      Found in salt/cloud/clouds/gce.py - About 1 hr to fix

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

        def __virtual__():
            '''
            Set up the libcloud functions and check for GCE configurations.
            '''
            if get_configured_provider() is False:
        Severity: Minor
        Found in salt/cloud/clouds/gce.py - About 45 mins to fix

        Cognitive Complexity

        Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

        A method's cognitive complexity is based on a few simple rules:

        • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
        • Code is considered more complex for each "break in the linear flow of the code"
        • Code is considered more complex when "flow breaking structures are nested"

        Further reading

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

        def avail_images(conn=None):
            '''
            Return a dict of all available VM images on the cloud provider with
            relevant data.
        
        
        Severity: Minor
        Found in salt/cloud/clouds/gce.py - About 45 mins to fix

        Cognitive Complexity

        Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

        A method's cognitive complexity is based on a few simple rules:

        • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
        • Code is considered more complex for each "break in the linear flow of the code"
        • Code is considered more complex when "flow breaking structures are nested"

        Further reading

        Function create_lb has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
        Open

        def create_lb(kwargs=None, call=None):
            '''
            Create a load-balancer configuration.
        
            CLI Example:
        Severity: Minor
        Found in salt/cloud/clouds/gce.py - About 35 mins to fix

        Cognitive Complexity

        Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

        A method's cognitive complexity is based on a few simple rules:

        • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
        • Code is considered more complex for each "break in the linear flow of the code"
        • Code is considered more complex when "flow breaking structures are nested"

        Further reading

        Function attach_disk has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
        Open

        def attach_disk(name=None, kwargs=None, call=None):
            '''
            Attach an existing disk to an existing instance.
        
            CLI Example:
        Severity: Minor
        Found in salt/cloud/clouds/gce.py - About 35 mins to fix

        Cognitive Complexity

        Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

        A method's cognitive complexity is based on a few simple rules:

        • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
        • Code is considered more complex for each "break in the linear flow of the code"
        • Code is considered more complex when "flow breaking structures are nested"

        Further reading

        Function detach_lb has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
        Open

        def detach_lb(kwargs=None, call=None):
            '''
            Remove an existing node/member from an existing load-balancer configuration.
        
            CLI Example:
        Severity: Minor
        Found in salt/cloud/clouds/gce.py - About 35 mins to fix

        Cognitive Complexity

        Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

        A method's cognitive complexity is based on a few simple rules:

        • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
        • Code is considered more complex for each "break in the linear flow of the code"
        • Code is considered more complex when "flow breaking structures are nested"

        Further reading

        Avoid too many return statements within this function.
        Open

            return _expand_item(subnet)
        Severity: Major
        Found in salt/cloud/clouds/gce.py - About 30 mins to fix

          Avoid too many return statements within this function.
          Open

              return _expand_balancer(lb)
          Severity: Major
          Found in salt/cloud/clouds/gce.py - About 30 mins to fix

            Function create_fwrule has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
            Open

            def create_fwrule(kwargs=None, call=None):
                '''
                Create a GCE firewall rule. The 'default' network is used if not specified.
            
                CLI Example:
            Severity: Minor
            Found in salt/cloud/clouds/gce.py - About 25 mins to fix

            Cognitive Complexity

            Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

            A method's cognitive complexity is based on a few simple rules:

            • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
            • Code is considered more complex for each "break in the linear flow of the code"
            • Code is considered more complex when "flow breaking structures are nested"

            Further reading

            Function create_disk has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
            Open

            def create_disk(kwargs=None, call=None):
            
                '''
                Create a new persistent disk. Must specify `disk_name` and `location`,
                and optionally can specify 'disk_type' as pd-standard or pd-ssd, which
            Severity: Minor
            Found in salt/cloud/clouds/gce.py - About 25 mins to fix

            Cognitive Complexity

            Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

            A method's cognitive complexity is based on a few simple rules:

            • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
            • Code is considered more complex for each "break in the linear flow of the code"
            • Code is considered more complex when "flow breaking structures are nested"

            Further reading

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

            def delete_network(kwargs=None, call=None):
                '''
                Permanently delete a network.
            
                CLI Example:
            Severity: Major
            Found in salt/cloud/clouds/gce.py and 3 other locations - About 1 day to fix
            salt/cloud/clouds/gce.py on lines 989..1045
            salt/cloud/clouds/gce.py on lines 1148..1204
            salt/cloud/clouds/gce.py on lines 1675..1731

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

            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 delete_hc(kwargs=None, call=None):
                '''
                Permanently delete a health check.
            
                CLI Example:
            Severity: Major
            Found in salt/cloud/clouds/gce.py and 3 other locations - About 1 day to fix
            salt/cloud/clouds/gce.py on lines 645..701
            salt/cloud/clouds/gce.py on lines 989..1045
            salt/cloud/clouds/gce.py on lines 1675..1731

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

            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 delete_fwrule(kwargs=None, call=None):
                '''
                Permanently delete a firewall rule.
            
                CLI Example:
            Severity: Major
            Found in salt/cloud/clouds/gce.py and 3 other locations - About 1 day to fix
            salt/cloud/clouds/gce.py on lines 645..701
            salt/cloud/clouds/gce.py on lines 1148..1204
            salt/cloud/clouds/gce.py on lines 1675..1731

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

            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 delete_snapshot(kwargs=None, call=None):
                '''
                Permanently delete a disk snapshot.
            
                CLI Example:
            Severity: Major
            Found in salt/cloud/clouds/gce.py and 3 other locations - About 1 day to fix
            salt/cloud/clouds/gce.py on lines 645..701
            salt/cloud/clouds/gce.py on lines 989..1045
            salt/cloud/clouds/gce.py on lines 1148..1204

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

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

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

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

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

            Refactorings

            Further Reading

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

            def start(vm_name, call=None):
                '''
                Call GCE 'start on the instance.
            
                .. versionadded:: 2017.7.0
            Severity: Major
            Found in salt/cloud/clouds/gce.py and 2 other locations - About 1 day to fix
            salt/cloud/clouds/gce.py on lines 2137..2176
            salt/cloud/clouds/gce.py on lines 2223..2264

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

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

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

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

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

            Refactorings

            Further Reading

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

            def reboot(vm_name, call=None):
                '''
                Call GCE 'reset' on the instance.
            
                CLI Example:
            Severity: Major
            Found in salt/cloud/clouds/gce.py and 2 other locations - About 1 day to fix
            salt/cloud/clouds/gce.py on lines 2179..2220
            salt/cloud/clouds/gce.py on lines 2223..2264

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

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

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

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

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

            Refactorings

            Further Reading

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

            def stop(vm_name, call=None):
                '''
                Call GCE 'stop' on the instance.
            
                .. versionadded:: 2017.7.0
            Severity: Major
            Found in salt/cloud/clouds/gce.py and 2 other locations - About 1 day to fix
            salt/cloud/clouds/gce.py on lines 2137..2176
            salt/cloud/clouds/gce.py on lines 2179..2220

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

            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 show_fwrule(kwargs=None, call=None):
                '''
                Show the details of an existing firewall rule.
            
                CLI Example:
            Severity: Major
            Found in salt/cloud/clouds/gce.py and 3 other locations - About 4 hrs to fix
            salt/cloud/clouds/gce.py on lines 704..725
            salt/cloud/clouds/gce.py on lines 1207..1228
            salt/cloud/clouds/gce.py on lines 1973..1994

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

            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 show_snapshot(kwargs=None, call=None):
                '''
                Show the details of an existing snapshot.
            
                CLI Example:
            Severity: Major
            Found in salt/cloud/clouds/gce.py and 3 other locations - About 4 hrs to fix
            salt/cloud/clouds/gce.py on lines 704..725
            salt/cloud/clouds/gce.py on lines 1048..1069
            salt/cloud/clouds/gce.py on lines 1207..1228

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

            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 show_network(kwargs=None, call=None):
                '''
                Show the details of an existing network.
            
                CLI Example:
            Severity: Major
            Found in salt/cloud/clouds/gce.py and 3 other locations - About 4 hrs to fix
            salt/cloud/clouds/gce.py on lines 1048..1069
            salt/cloud/clouds/gce.py on lines 1207..1228
            salt/cloud/clouds/gce.py on lines 1973..1994

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

            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 show_hc(kwargs=None, call=None):
                '''
                Show the details of an existing health check.
            
                CLI Example:
            Severity: Major
            Found in salt/cloud/clouds/gce.py and 3 other locations - About 4 hrs to fix
            salt/cloud/clouds/gce.py on lines 704..725
            salt/cloud/clouds/gce.py on lines 1048..1069
            salt/cloud/clouds/gce.py on lines 1973..1994

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

            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',
                    'create instance',
                    '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/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 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/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 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 2 locations. Consider refactoring.
            Open

                __utils__['cloud.fire_event'](
                    'event',
                    'delete disk',
                    'salt/cloud/disk/deleting',
                    args={
            Severity: Major
            Found in salt/cloud/clouds/gce.py and 1 other location - About 2 hrs to fix
            salt/cloud/clouds/gce.py on lines 1782..1792

            Duplicated Code

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

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

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

            Tuning

            This issue has a mass of 59.

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

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

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

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

            Refactorings

            Further Reading

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

                __utils__['cloud.fire_event'](
                    'event',
                    'deleted disk',
                    'salt/cloud/disk/deleted',
                    args={
            Severity: Major
            Found in salt/cloud/clouds/gce.py and 1 other location - About 2 hrs to fix
            salt/cloud/clouds/gce.py on lines 1759..1769

            Duplicated Code

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

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

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

            Tuning

            This issue has a mass of 59.

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

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

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

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

            Refactorings

            Further Reading

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

                try:
                    # Check for required profile parameters before sending any API calls.
                    if vm_['profile'] and config.is_profile_configured(__opts__,
                                                                       __active_provider_name__ or 'gce',
                                                                       vm_['profile'],
            Severity: Major
            Found in salt/cloud/clouds/gce.py and 17 other locations - About 1 hr to fix
            salt/cloud/clouds/aliyun.py on lines 615..622
            salt/cloud/clouds/azurearm.py on lines 1384..1392
            salt/cloud/clouds/cloudstack.py on lines 270..277
            salt/cloud/clouds/digitalocean.py on lines 277..284
            salt/cloud/clouds/ec2.py on lines 2554..2561
            salt/cloud/clouds/gogrid.py on lines 86..93
            salt/cloud/clouds/joyent.py on lines 260..267
            salt/cloud/clouds/linode.py on lines 328..335
            salt/cloud/clouds/msazure.py on lines 419..426
            salt/cloud/clouds/nova.py on lines 938..945
            salt/cloud/clouds/parallels.py on lines 277..284
            salt/cloud/clouds/proxmox.py on lines 566..573
            salt/cloud/clouds/qingcloud.py on lines 658..665
            salt/cloud/clouds/scaleway.py on lines 190..197
            salt/cloud/clouds/softlayer.py on lines 248..255
            salt/cloud/clouds/softlayer_hw.py on lines 216..223
            salt/cloud/clouds/vmware.py on lines 2532..2540

            Duplicated Code

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

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

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

            Tuning

            This issue has a mass of 55.

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

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

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

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

            Refactorings

            Further Reading

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

                __utils__['cloud.fire_event'](
                    'event',
                    'created health_check',
                    'salt/cloud/healthcheck/created',
                    args={
            Severity: Major
            Found in salt/cloud/clouds/gce.py and 1 other location - About 1 hr to fix
            salt/cloud/clouds/gce.py on lines 1104..1119

            Duplicated Code

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

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

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

            Tuning

            This issue has a mass of 55.

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

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

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

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

            Refactorings

            Further Reading

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

                __utils__['cloud.fire_event'](
                    'event',
                    'create health_check',
                    'salt/cloud/healthcheck/creating',
                    args={
            Severity: Major
            Found in salt/cloud/clouds/gce.py and 1 other location - About 1 hr to fix
            salt/cloud/clouds/gce.py on lines 1128..1143

            Duplicated Code

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

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

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

            Tuning

            This issue has a mass of 55.

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

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

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

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

            Refactorings

            Further Reading

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

                __utils__['cloud.fire_event'](
                    'event',
                    'created firewall',
                    'salt/cloud/firewall/created',
                    args={
            Severity: Major
            Found in salt/cloud/clouds/gce.py and 1 other location - About 1 hr to fix
            salt/cloud/clouds/gce.py on lines 953..963

            Duplicated Code

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

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

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

            Tuning

            This issue has a mass of 51.

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

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

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

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

            Refactorings

            Further Reading

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

                __utils__['cloud.fire_event'](
                    'event',
                    'create firewall',
                    'salt/cloud/firewall/creating',
                    args={
            Severity: Major
            Found in salt/cloud/clouds/gce.py and 1 other location - About 1 hr to fix
            salt/cloud/clouds/gce.py on lines 974..984

            Duplicated Code

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

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

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

            Tuning

            This issue has a mass of 51.

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

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

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

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

            Refactorings

            Further Reading

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

                try:
                    inst_deleted = conn.destroy_node(node)
                except Exception as exc:  # pylint: disable=W0703
                    log.error(
                        'Could not destroy instance %s\n\n'
            Severity: Major
            Found in salt/cloud/clouds/gce.py and 1 other location - About 1 hr to fix
            salt/cloud/clouds/gce.py on lines 2285..2295

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

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

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

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

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

            Refactorings

            Further Reading

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

                try:
                    node = conn.ex_get_node(vm_name)
                except Exception as exc:  # pylint: disable=W0703
                    log.error(
                        'Could not locate instance %s\n\n'
            Severity: Major
            Found in salt/cloud/clouds/gce.py and 1 other location - About 1 hr to fix
            salt/cloud/clouds/gce.py on lines 2322..2332

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

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

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

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

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

            Refactorings

            Further Reading

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

                __utils__['cloud.fire_event'](
                    'event',
                    'create subnetwork',
                    'salt/cloud/subnet/creating',
                    args={
            Severity: Major
            Found in salt/cloud/clouds/gce.py and 1 other location - About 1 hr to fix
            salt/cloud/clouds/gce.py on lines 792..804

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

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

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

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

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

            Refactorings

            Further Reading

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

                __utils__['cloud.fire_event'](
                    'event',
                    'created subnetwork',
                    'salt/cloud/subnet/created',
                    args={
            Severity: Major
            Found in salt/cloud/clouds/gce.py and 1 other location - About 1 hr to fix
            salt/cloud/clouds/gce.py on lines 775..787

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

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

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

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

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

            Refactorings

            Further Reading

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

                __utils__['cloud.fire_event'](
                    'event',
                    'create disk',
                    'salt/cloud/disk/creating',
                    args={
            Severity: Major
            Found in salt/cloud/clouds/gce.py and 1 other location - About 1 hr to fix
            salt/cloud/clouds/gce.py on lines 1867..1878

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

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

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

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

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

            Refactorings

            Further Reading

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

                __utils__['cloud.fire_event'](
                    'event',
                    'created disk',
                    'salt/cloud/disk/created',
                    args={
            Severity: Major
            Found in salt/cloud/clouds/gce.py and 1 other location - About 1 hr to fix
            salt/cloud/clouds/gce.py on lines 1849..1860

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

            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

                __utils__['cloud.fire_event'](
                    'event',
                    'created network',
                    'salt/cloud/net/created',
                    args={
            Severity: Major
            Found in salt/cloud/clouds/gce.py and 3 other locations - About 1 hr to fix
            salt/cloud/clouds/gce.py on lines 613..624
            salt/cloud/clouds/gce.py on lines 2104..2115
            salt/cloud/clouds/gce.py on lines 2121..2132

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

            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

                __utils__['cloud.fire_event'](
                    'event',
                    'creating network',
                    'salt/cloud/net/creating',
                    args={
            Severity: Major
            Found in salt/cloud/clouds/gce.py and 3 other locations - About 1 hr to fix
            salt/cloud/clouds/gce.py on lines 629..640
            salt/cloud/clouds/gce.py on lines 2104..2115
            salt/cloud/clouds/gce.py on lines 2121..2132

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

            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

                __utils__['cloud.fire_event'](
                    'event',
                    'attach disk',
                    'salt/cloud/disk/attaching',
                    args={
            Severity: Major
            Found in salt/cloud/clouds/gce.py and 3 other locations - About 1 hr to fix
            salt/cloud/clouds/gce.py on lines 613..624
            salt/cloud/clouds/gce.py on lines 629..640
            salt/cloud/clouds/gce.py on lines 2121..2132

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

            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

                __utils__['cloud.fire_event'](
                    'event',
                    'attached disk',
                    'salt/cloud/disk/attached',
                    args={
            Severity: Major
            Found in salt/cloud/clouds/gce.py and 3 other locations - About 1 hr to fix
            salt/cloud/clouds/gce.py on lines 613..624
            salt/cloud/clouds/gce.py on lines 629..640
            salt/cloud/clouds/gce.py on lines 2104..2115

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

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

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

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

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

            Refactorings

            Further Reading

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

                __utils__['cloud.fire_event'](
                    'event',
                    'created address',
                    'salt/cloud/address/created',
                    args=salt.utils.data.simple_types_filter(kwargs),
            Severity: Major
            Found in salt/cloud/clouds/gce.py and 1 other location - About 1 hr to fix
            salt/cloud/clouds/gce.py on lines 1264..1270

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

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

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

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

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

            Refactorings

            Further Reading

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

                __utils__['cloud.fire_event'](
                    'event',
                    'create address',
                    'salt/cloud/address/creating',
                    args=salt.utils.data.simple_types_filter(kwargs),
            Severity: Major
            Found in salt/cloud/clouds/gce.py and 1 other location - About 1 hr to fix
            salt/cloud/clouds/gce.py on lines 1275..1281

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

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

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

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

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

            Refactorings

            Further Reading

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

                try:
                    node_data = conn.create_node(**kwargs)
                except Exception as exc:  # pylint: disable=W0703
                    log.error(
                        'Error creating %s on GCE\n\n'
            Severity: Major
            Found in salt/cloud/clouds/gce.py and 2 other locations - About 1 hr to fix
            salt/cloud/clouds/cloudstack.py on lines 375..386
            salt/cloud/clouds/dimensiondata.py on lines 269..279

            Duplicated Code

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

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

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

            Tuning

            This issue has a mass of 46.

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

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

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

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

            Refactorings

            Further Reading

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

                if __opts__.get('update_cachedir', False) is True:
                    __utils__['cloud.delete_minion_cachedir'](vm_name, __active_provider_name__.split(':')[0], __opts__)
            Severity: Major
            Found in salt/cloud/clouds/gce.py and 22 other locations - About 50 mins to fix
            salt/cloud/clouds/azurearm.py on lines 1528..1532
            salt/cloud/clouds/digitalocean.py on lines 868..869
            salt/cloud/clouds/ec2.py on lines 3417..3418
            salt/cloud/clouds/gogrid.py on lines 421..422
            salt/cloud/clouds/joyent.py on lines 429..430
            salt/cloud/clouds/linode.py on lines 758..759
            salt/cloud/clouds/lxc.py on lines 415..416
            salt/cloud/clouds/msazure.py on lines 947..948
            salt/cloud/clouds/nova.py on lines 569..570
            salt/cloud/clouds/oneandone.py on lines 918..922
            salt/cloud/clouds/opennebula.py on lines 1226..1230
            salt/cloud/clouds/openstack.py on lines 816..817
            salt/cloud/clouds/parallels.py on lines 561..562
            salt/cloud/clouds/profitbricks.py on lines 1023..1027
            salt/cloud/clouds/proxmox.py on lines 1194..1196
            salt/cloud/clouds/scaleway.py on lines 456..458
            salt/cloud/clouds/softlayer.py on lines 637..638
            salt/cloud/clouds/softlayer_hw.py on lines 547..548
            salt/cloud/clouds/vagrant.py on lines 308..310
            salt/cloud/clouds/vmware.py on lines 2513..2514
            salt/cloud/clouds/xen.py on lines 1046..1050
            salt/cloud/libcloudfuncs.py on lines 403..404

            Duplicated Code

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

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

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

            Tuning

            This issue has a mass of 44.

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

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

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

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

            Refactorings

            Further Reading

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

                __utils__['cloud.fire_event'](
                    'event',
                    'deleted subnetwork',
                    'salt/cloud/subnet/deleted',
                    args={
            Severity: Major
            Found in salt/cloud/clouds/gce.py and 5 other locations - About 45 mins to fix
            salt/cloud/clouds/gce.py on lines 842..851
            salt/cloud/clouds/gce.py on lines 1924..1933
            salt/cloud/clouds/gce.py on lines 1938..1947
            salt/cloud/clouds/gce.py on lines 2030..2039
            salt/cloud/clouds/gce.py on lines 2044..2053

            Duplicated Code

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

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

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

            Tuning

            This issue has a mass of 43.

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

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

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

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

            Refactorings

            Further Reading

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

                __utils__['cloud.fire_event'](
                    'event',
                    'deleting subnetwork',
                    'salt/cloud/subnet/deleting',
                    args={
            Severity: Major
            Found in salt/cloud/clouds/gce.py and 5 other locations - About 45 mins to fix
            salt/cloud/clouds/gce.py on lines 863..872
            salt/cloud/clouds/gce.py on lines 1924..1933
            salt/cloud/clouds/gce.py on lines 1938..1947
            salt/cloud/clouds/gce.py on lines 2030..2039
            salt/cloud/clouds/gce.py on lines 2044..2053

            Duplicated Code

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

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

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

            Tuning

            This issue has a mass of 43.

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

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

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

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

            Refactorings

            Further Reading

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

                __utils__['cloud.fire_event'](
                    'event',
                    'created snapshot',
                    'salt/cloud/snapshot/created',
                    args={
            Severity: Major
            Found in salt/cloud/clouds/gce.py and 5 other locations - About 45 mins to fix
            salt/cloud/clouds/gce.py on lines 842..851
            salt/cloud/clouds/gce.py on lines 863..872
            salt/cloud/clouds/gce.py on lines 1924..1933
            salt/cloud/clouds/gce.py on lines 2030..2039
            salt/cloud/clouds/gce.py on lines 2044..2053

            Duplicated Code

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

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

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

            Tuning

            This issue has a mass of 43.

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

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

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

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

            Refactorings

            Further Reading

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

                __utils__['cloud.fire_event'](
                    'event',
                    'detached disk',
                    'salt/cloud/disk/detached',
                    args={
            Severity: Major
            Found in salt/cloud/clouds/gce.py and 5 other locations - About 45 mins to fix
            salt/cloud/clouds/gce.py on lines 842..851
            salt/cloud/clouds/gce.py on lines 863..872
            salt/cloud/clouds/gce.py on lines 1924..1933
            salt/cloud/clouds/gce.py on lines 1938..1947
            salt/cloud/clouds/gce.py on lines 2030..2039

            Duplicated Code

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

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

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

            Tuning

            This issue has a mass of 43.

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

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

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

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

            Refactorings

            Further Reading

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

                __utils__['cloud.fire_event'](
                    'event',
                    'detach disk',
                    'salt/cloud/disk/detaching',
                    args={
            Severity: Major
            Found in salt/cloud/clouds/gce.py and 5 other locations - About 45 mins to fix
            salt/cloud/clouds/gce.py on lines 842..851
            salt/cloud/clouds/gce.py on lines 863..872
            salt/cloud/clouds/gce.py on lines 1924..1933
            salt/cloud/clouds/gce.py on lines 1938..1947
            salt/cloud/clouds/gce.py on lines 2044..2053

            Duplicated Code

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

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

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

            Tuning

            This issue has a mass of 43.

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

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

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

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

            Refactorings

            Further Reading

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

                __utils__['cloud.fire_event'](
                    'event',
                    'create snapshot',
                    'salt/cloud/snapshot/creating',
                    args={
            Severity: Major
            Found in salt/cloud/clouds/gce.py and 5 other locations - About 45 mins to fix
            salt/cloud/clouds/gce.py on lines 842..851
            salt/cloud/clouds/gce.py on lines 863..872
            salt/cloud/clouds/gce.py on lines 1938..1947
            salt/cloud/clouds/gce.py on lines 2030..2039
            salt/cloud/clouds/gce.py on lines 2044..2053

            Duplicated Code

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

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

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

            Tuning

            This issue has a mass of 43.

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

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

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

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

            Refactorings

            Further Reading

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

                try:
                    disk = conn.ex_get_volume(disk_name)
                except ResourceNotFoundError as exc:
                    log.error(
                        'Disk %s was not found. Exception was: %s',
            Severity: Minor
            Found in salt/cloud/clouds/gce.py and 2 other locations - About 30 mins to fix
            salt/cloud/clouds/softlayer.py on lines 412..422
            salt/cloud/clouds/softlayer_hw.py on lines 335..347

            Duplicated Code

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

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

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

            Tuning

            This issue has a mass of 40.

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

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

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

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

            Refactorings

            Further Reading

            There are no issues that match your filters.

            Category
            Status