saltstack/salt

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

Summary

Maintainability
F
1 mo
Test Coverage

File msazure.py has 2587 lines of code (exceeds 250 allowed). Consider refactoring.
Open

# -*- coding: utf-8 -*-
'''
Azure Cloud Module
==================

Severity: Major
Found in salt/cloud/clouds/msazure.py - About 1 wk to fix

    Function create has a Cognitive Complexity of 35 (exceeds 5 allowed). Consider refactoring.
    Open

    def create(vm_):
        '''
        Create a single VM from a data dict
        '''
        try:
    Severity: Minor
    Found in salt/cloud/clouds/msazure.py - About 5 hrs to fix

    Cognitive Complexity

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

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

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

    Further reading

    Function update_input_endpoint has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
    Open

    def update_input_endpoint(kwargs=None, conn=None, call=None, activity='update'):
        '''
        .. versionadded:: 2015.8.0
    
        Update an input endpoint associated with the deployment. Please note that
    Severity: Minor
    Found in salt/cloud/clouds/msazure.py - About 3 hrs to fix

    Cognitive Complexity

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

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

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

    Further reading

    Function list_nodes_full has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
    Open

    def list_nodes_full(conn=None, call=None):
        '''
        List VMs on this Azure account, with full information
        '''
        if call == 'action':
    Severity: Minor
    Found in salt/cloud/clouds/msazure.py - About 3 hrs to fix

    Cognitive Complexity

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

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

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

    Further reading

    Function list_input_endpoints has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
    Open

    def list_input_endpoints(kwargs=None, conn=None, call=None):
        '''
        .. versionadded:: 2015.8.0
    
        List input endpoints associated with the deployment
    Severity: Minor
    Found in salt/cloud/clouds/msazure.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 19 (exceeds 5 allowed). Consider refactoring.
    Open

    def destroy(name, conn=None, call=None, kwargs=None):
        '''
        Destroy a VM
    
        CLI Examples:
    Severity: Minor
    Found in salt/cloud/clouds/msazure.py - About 2 hrs to fix

    Cognitive Complexity

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

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

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

    Further reading

    Cyclomatic complexity is too high in function create. (21)
    Open

    def create(vm_):
        '''
        Create a single VM from a data dict
        '''
        try:
    Severity: Minor
    Found in salt/cloud/clouds/msazure.py by radon

    Cyclomatic Complexity

    Cyclomatic Complexity corresponds to the number of decisions a block of code contains plus 1. This number (also called McCabe number) is equal to the number of linearly independent paths through the code. This number can be used as a guide when testing conditional logic in blocks.

    Radon analyzes the AST tree of a Python program to compute Cyclomatic Complexity. Statements have the following effects on Cyclomatic Complexity:

    Construct Effect on CC Reasoning
    if +1 An if statement is a single decision.
    elif +1 The elif statement adds another decision.
    else +0 The else statement does not cause a new decision. The decision is at the if.
    for +1 There is a decision at the start of the loop.
    while +1 There is a decision at the while statement.
    except +1 Each except branch adds a new conditional path of execution.
    finally +0 The finally block is unconditionally executed.
    with +1 The with statement roughly corresponds to a try/except block (see PEP 343 for details).
    assert +1 The assert statement internally roughly equals a conditional statement.
    Comprehension +1 A list/set/dict comprehension of generator expression is equivalent to a for loop.
    Boolean Operator +1 Every boolean operator (and, or) adds a decision point.

    Source: http://radon.readthedocs.org/en/latest/intro.html

    Function create has 41 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    def create(vm_):
        '''
        Create a single VM from a data dict
        '''
        try:
    Severity: Minor
    Found in salt/cloud/clouds/msazure.py - About 1 hr to fix

      Function create_attach_volumes has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
      Open

      def create_attach_volumes(name, kwargs, call=None, wait_to_finish=True):
          '''
          Create and attach volumes to created node
          '''
          if call != 'action':
      Severity: Minor
      Found in salt/cloud/clouds/msazure.py - About 1 hr to fix

      Cognitive Complexity

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

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

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

      Further reading

      Function list_hosted_services has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
      Open

      def list_hosted_services(conn=None, call=None):
          '''
          List VMs on this Azure account, with full information
          '''
          if call == 'action':
      Severity: Minor
      Found in salt/cloud/clouds/msazure.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 create_storage has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
      Open

      def create_storage(kwargs=None, conn=None, call=None):
          '''
          .. versionadded:: 2015.8.0
      
          Create a new storage account
      Severity: Minor
      Found in salt/cloud/clouds/msazure.py - About 55 mins to fix

      Cognitive Complexity

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

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

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

      Further reading

      Function create_attach_volumes has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
      Open

      def create_attach_volumes(name, kwargs, call=None, wait_to_finish=True):
          '''
          Create and attach volumes to created node
          '''
          if call != 'action':
      Severity: Minor
      Found in salt/cloud/clouds/msazure.py - About 55 mins to fix

      Cognitive Complexity

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

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

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

      Further reading

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

      def add_service_certificate(kwargs=None, conn=None, call=None):
          '''
          .. versionadded:: 2015.8.0
      
          Add a new service certificate
      Severity: Minor
      Found in salt/cloud/clouds/msazure.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 show_storage_keys has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

      def show_storage_keys(kwargs=None, conn=None, call=None):
          '''
          .. versionadded:: 2015.8.0
      
          Show storage account keys
      Severity: Minor
      Found in salt/cloud/clouds/msazure.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_service has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

      def create_service(kwargs=None, conn=None, call=None):
          '''
          .. versionadded:: 2015.8.0
      
          Create a new hosted service
      Severity: Minor
      Found in salt/cloud/clouds/msazure.py - About 45 mins to fix

      Cognitive Complexity

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

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

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

      Further reading

      Avoid deeply nested control flow statements.
      Open

                          if salt.utils.cloud.is_public_ip(ip_address):
                              ret[role]['public_ips'].append(ip_address)
                          else:
                              ret[role]['private_ips'].append(ip_address)
                      ret[role]['size'] = role_instances[role]['instance_size']
      Severity: Major
      Found in salt/cloud/clouds/msazure.py - About 45 mins to fix

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

        def add_management_certificate(kwargs=None, conn=None, call=None):
            '''
            .. versionadded:: 2015.8.0
        
            Add a new management certificate
        Severity: Minor
        Found in salt/cloud/clouds/msazure.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 regenerate_storage_keys has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
        Open

        def regenerate_storage_keys(kwargs=None, conn=None, call=None):
            '''
            .. versionadded:: 2015.8.0
        
            Regenerate storage account keys. Requires a key_type ("primary" or
        Severity: Minor
        Found in salt/cloud/clouds/msazure.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 delete_service_certificate has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
        Open

        def delete_service_certificate(kwargs=None, conn=None, call=None):
            '''
            .. versionadded:: 2015.8.0
        
            Delete a specific certificate associated with the service
        Severity: Minor
        Found in salt/cloud/clouds/msazure.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 create_affinity_group has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
        Open

        def create_affinity_group(kwargs=None, conn=None, call=None):
            '''
            .. versionadded:: 2015.8.0
        
            Create a new affinity group
        Severity: Minor
        Found in salt/cloud/clouds/msazure.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 ret
        Severity: Major
        Found in salt/cloud/clouds/msazure.py - About 30 mins to fix

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

          def show_service_certificate(kwargs=None, conn=None, call=None):
              '''
              .. versionadded:: 2015.8.0
          
              Return information about a service certificate
          Severity: Minor
          Found in salt/cloud/clouds/msazure.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 show_blob_properties has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
          Open

          def show_blob_properties(kwargs=None, storage_conn=None, call=None):
              '''
              .. versionadded:: 2015.8.0
          
              Returns all user-defined metadata, standard HTTP properties, and
          Severity: Minor
          Found in salt/cloud/clouds/msazure.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 put_blob has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
          Open

          def put_blob(kwargs=None, storage_conn=None, call=None):
              '''
              .. versionadded:: 2015.8.0
          
              Upload a blob
          Severity: Minor
          Found in salt/cloud/clouds/msazure.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 make_blob_url has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
          Open

          def make_blob_url(kwargs=None, storage_conn=None, call=None):
              '''
              .. versionadded:: 2015.8.0
          
              Creates the URL to access a blob
          Severity: Minor
          Found in salt/cloud/clouds/msazure.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 lease_storage_container has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
          Open

          def lease_storage_container(kwargs=None, storage_conn=None, call=None):
              '''
              .. versionadded:: 2015.8.0
          
              Lease a container associated with the storage account
          Severity: Minor
          Found in salt/cloud/clouds/msazure.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 get_blob has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
          Open

          def get_blob(kwargs=None, storage_conn=None, call=None):
              '''
              .. versionadded:: 2015.8.0
          
              Download a blob
          Severity: Minor
          Found in salt/cloud/clouds/msazure.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 2 locations. Consider refactoring.
          Open

          def put_blob(kwargs=None, storage_conn=None, call=None):
              '''
              .. versionadded:: 2015.8.0
          
              Upload a blob
          Severity: Major
          Found in salt/cloud/clouds/msazure.py and 1 other location - About 1 day to fix
          salt/cloud/clouds/msazure.py on lines 3299..3366

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

          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

          def get_blob(kwargs=None, storage_conn=None, call=None):
              '''
              .. versionadded:: 2015.8.0
          
              Download a blob
          Severity: Major
          Found in salt/cloud/clouds/msazure.py and 1 other location - About 1 day to fix
          salt/cloud/clouds/msazure.py on lines 3224..3296

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

          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 delete_affinity_group(kwargs=None, conn=None, call=None):
              '''
              .. versionadded:: 2015.8.0
          
              Delete a specific affinity group associated with the account
          Severity: Major
          Found in salt/cloud/clouds/msazure.py and 2 other locations - About 1 day to fix
          salt/cloud/clouds/msazure.py on lines 1465..1495
          salt/cloud/clouds/msazure.py on lines 1948..1979

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

          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 delete_service(kwargs=None, conn=None, call=None):
              '''
              .. versionadded:: 2015.8.0
          
              Delete a specific service associated with the account
          Severity: Major
          Found in salt/cloud/clouds/msazure.py and 2 other locations - About 1 day to fix
          salt/cloud/clouds/msazure.py on lines 1948..1979
          salt/cloud/clouds/msazure.py on lines 2436..2466

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

          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 delete_management_certificate(kwargs=None, conn=None, call=None):
              '''
              .. versionadded:: 2015.8.0
          
              Delete a specific certificate associated with the management
          Severity: Major
          Found in salt/cloud/clouds/msazure.py and 2 other locations - About 1 day to fix
          salt/cloud/clouds/msazure.py on lines 1465..1495
          salt/cloud/clouds/msazure.py on lines 2436..2466

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

          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_storage_container_acl(kwargs=None, storage_conn=None, call=None):
              '''
              .. versionadded:: 2015.8.0
          
              Show a storage container's acl
          Severity: Major
          Found in salt/cloud/clouds/msazure.py and 3 other locations - About 6 hrs to fix
          salt/cloud/clouds/msazure.py on lines 2618..2651
          salt/cloud/clouds/msazure.py on lines 2658..2694
          salt/cloud/clouds/msazure.py on lines 3061..3099

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

          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_storage_container_metadata(kwargs=None, storage_conn=None, call=None):
              '''
              .. versionadded:: 2015.8.0
          
              Show a storage container's metadata
          Severity: Major
          Found in salt/cloud/clouds/msazure.py and 3 other locations - About 6 hrs to fix
          salt/cloud/clouds/msazure.py on lines 2618..2651
          salt/cloud/clouds/msazure.py on lines 2752..2788
          salt/cloud/clouds/msazure.py on lines 3061..3099

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

          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_storage_container(kwargs=None, storage_conn=None, call=None):
              '''
              .. versionadded:: 2015.8.0
          
              Show a container associated with the storage account
          Severity: Major
          Found in salt/cloud/clouds/msazure.py and 3 other locations - About 6 hrs to fix
          salt/cloud/clouds/msazure.py on lines 2658..2694
          salt/cloud/clouds/msazure.py on lines 2752..2788
          salt/cloud/clouds/msazure.py on lines 3061..3099

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

          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 set_blob_service_properties(kwargs=None, storage_conn=None, call=None):
              '''
              .. versionadded:: 2015.8.0
          
              Sets the properties of a storage account's Blob service, including
          Severity: Major
          Found in salt/cloud/clouds/msazure.py and 3 other locations - About 6 hrs to fix
          salt/cloud/clouds/msazure.py on lines 2618..2651
          salt/cloud/clouds/msazure.py on lines 2658..2694
          salt/cloud/clouds/msazure.py on lines 2752..2788

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

          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 show_storage(kwargs=None, conn=None, call=None):
              '''
              .. versionadded:: 2015.8.0
          
              List storage service properties
          Severity: Major
          Found in salt/cloud/clouds/msazure.py and 2 other locations - About 5 hrs to fix
          salt/cloud/clouds/msazure.py on lines 1525..1552
          salt/cloud/clouds/msazure.py on lines 1868..1896

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

          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 show_management_certificate(kwargs=None, conn=None, call=None):
              '''
              .. versionadded:: 2015.8.0
          
              Return information about a management_certificate
          Severity: Major
          Found in salt/cloud/clouds/msazure.py and 2 other locations - About 5 hrs to fix
          salt/cloud/clouds/msazure.py on lines 1115..1144
          salt/cloud/clouds/msazure.py on lines 1525..1552

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

          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 show_disk(kwargs=None, conn=None, call=None):
              '''
              .. versionadded:: 2015.8.0
          
              Return information about a disk
          Severity: Major
          Found in salt/cloud/clouds/msazure.py and 2 other locations - About 5 hrs to fix
          salt/cloud/clouds/msazure.py on lines 1115..1144
          salt/cloud/clouds/msazure.py on lines 1868..1896

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

          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 list_management_certificates(kwargs=None, conn=None, call=None):
              '''
              .. versionadded:: 2015.8.0
          
              List management certificates associated with the subscription
          Severity: Major
          Found in salt/cloud/clouds/msazure.py and 2 other locations - About 4 hrs to fix
          salt/cloud/clouds/msazure.py on lines 1498..1522
          salt/cloud/clouds/msazure.py on lines 2293..2317

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

          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 list_disks(kwargs=None, conn=None, call=None):
              '''
              .. versionadded:: 2015.8.0
          
              List disks associated with the account
          Severity: Major
          Found in salt/cloud/clouds/msazure.py and 2 other locations - About 4 hrs to fix
          salt/cloud/clouds/msazure.py on lines 1841..1865
          salt/cloud/clouds/msazure.py on lines 2293..2317

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

          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 list_affinity_groups(kwargs=None, conn=None, call=None):
              '''
              .. versionadded:: 2015.8.0
          
              List input endpoints associated with the deployment
          Severity: Major
          Found in salt/cloud/clouds/msazure.py and 2 other locations - About 4 hrs to fix
          salt/cloud/clouds/msazure.py on lines 1498..1522
          salt/cloud/clouds/msazure.py on lines 1841..1865

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

          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

              except Exception as exc:
                  error = 'The hosted service name is invalid.'
                  if error in six.text_type(exc):
                      log.error(
                          'Error creating %s on Azure.\n\n'
          Severity: Major
          Found in salt/cloud/clouds/msazure.py and 1 other location - About 3 hrs to fix
          salt/cloud/clouds/msazure.py on lines 591..616

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

          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

              except Exception as exc:
                  error = 'The hosted service name is invalid.'
                  if error in six.text_type(exc):
                      log.error(
                          'Error creating %s on Azure.\n\n'
          Severity: Major
          Found in salt/cloud/clouds/msazure.py and 1 other location - About 3 hrs to fix
          salt/cloud/clouds/msazure.py on lines 557..578

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

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

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

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

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

          Refactorings

          Further Reading

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

              for node in nodes:
                  ret[node] = {'name': node}
                  for prop in ('id', 'image', 'size', 'state', 'private_ips', 'public_ips'):
                      ret[node][prop] = nodes[node].get(prop)
          Severity: Major
          Found in salt/cloud/clouds/msazure.py and 1 other location - About 3 hrs to fix
          salt/cloud/clouds/azurearm.py on lines 511..514

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

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

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

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

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

          Refactorings

          Further Reading

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

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

          Duplicated Code

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

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

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

          Tuning

          This issue has a mass of 66.

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

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

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

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

          Refactorings

          Further Reading

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

              __utils__['cloud.fire_event'](
                  'event',
                  'starting create',
                  'salt/cloud/{0}/creating'.format(vm_['name']),
                  args=__utils__['cloud.filter_event']('creating', vm_, ['name', 'profile', 'provider', 'driver']),
          Severity: Major
          Found in salt/cloud/clouds/msazure.py and 37 other locations - About 2 hrs to fix
          salt/cloud/clouds/aliyun.py on lines 625..631
          salt/cloud/clouds/aliyun.py on lines 732..738
          salt/cloud/clouds/azurearm.py on lines 1349..1359
          salt/cloud/clouds/azurearm.py on lines 1398..1406
          salt/cloud/clouds/azurearm.py on lines 1480..1489
          salt/cloud/clouds/digitalocean.py on lines 287..293
          salt/cloud/clouds/digitalocean.py on lines 537..543
          salt/cloud/clouds/dimensiondata.py on lines 207..213
          salt/cloud/clouds/dimensiondata.py on lines 337..343
          salt/cloud/clouds/ec2.py on lines 2579..2585
          salt/cloud/clouds/gce.py on lines 2461..2467
          salt/cloud/clouds/gce.py on lines 2551..2557
          salt/cloud/clouds/gce.py on lines 2635..2641
          salt/cloud/clouds/gogrid.py on lines 96..102
          salt/cloud/clouds/gogrid.py on lines 180..186
          salt/cloud/clouds/joyent.py on lines 274..280
          salt/cloud/clouds/joyent.py on lines 325..331
          salt/cloud/clouds/lxc.py on lines 440..446
          salt/cloud/clouds/lxc.py on lines 460..466
          salt/cloud/clouds/lxc.py on lines 488..494
          salt/cloud/clouds/msazure.py on lines 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 10 locations. Consider refactoring.
          Open

              __utils__['cloud.fire_event'](
                  'event',
                  'requesting instance',
                  'salt/cloud/{0}/requesting'.format(vm_['name']),
                  args=__utils__['cloud.filter_event']('requesting', event_kwargs, list(event_kwargs)),
          Severity: Major
          Found in salt/cloud/clouds/msazure.py and 9 other locations - About 2 hrs to fix
          salt/cloud/clouds/aliyun.py on lines 659..665
          salt/cloud/clouds/digitalocean.py on lines 448..454
          salt/cloud/clouds/dimensiondata.py on lines 256..262
          salt/cloud/clouds/ec2.py on lines 2860..2866
          salt/cloud/clouds/nova.py on lines 1068..1074
          salt/cloud/clouds/openstack.py on lines 767..773
          salt/cloud/clouds/virtualbox.py on lines 192..198
          salt/cloud/clouds/virtualbox.py on lines 218..224
          salt/cloud/clouds/vmware.py on lines 2988..2994

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

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

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

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

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

          Refactorings

          Further Reading

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

          def list_nodes_select(conn=None, call=None):
              '''
              Return a list of the VMs that are on the provider, with select fields
              '''
              if not conn:
          Severity: Major
          Found in salt/cloud/clouds/msazure.py and 2 other locations - About 2 hrs to fix
          salt/cloud/clouds/oneandone.py on lines 564..574
          salt/cloud/libcloudfuncs.py on lines 493..501

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

          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 'azure',
                                                                     vm_['profile'],
          Severity: Major
          Found in salt/cloud/clouds/msazure.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/gce.py on lines 2451..2458
          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/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 5 locations. Consider refactoring.
          Open

          def script(vm_):
              '''
              Return the script deployment object
              '''
              return salt.utils.cloud.os_script(
          Severity: Major
          Found in salt/cloud/clouds/msazure.py and 4 other locations - About 1 hr to fix
          salt/cloud/clouds/ec2.py on lines 968..977
          salt/cloud/clouds/oneandone.py on lines 485..494
          salt/cloud/clouds/parallels.py on lines 435..444
          salt/cloud/clouds/scaleway.py on lines 379..387

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

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

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

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

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

          Refactorings

          Further Reading

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

                          ret[service.service_name]['deployments'][deployment.name]['role_list'][role.role_name]['role_info'] = {
          Severity: Major
          Found in salt/cloud/clouds/msazure.py and 1 other location - About 1 hr to fix
          salt/cloud/clouds/msazure.py on lines 370..370

          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

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

                          ret[service.service_name]['deployments'][deployment.name]['role_list'][role.role_name]['role_info']['os_virtual_hard_disk'] = {
          Severity: Major
          Found in salt/cloud/clouds/msazure.py and 1 other location - About 1 hr to fix
          salt/cloud/clouds/msazure.py on lines 361..361

          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

              if isinstance(kwargs['volumes'], six.string_types):
                  volumes = salt.utils.yaml.safe_load(kwargs['volumes'])
              else:
                  volumes = kwargs['volumes']
          Severity: Major
          Found in salt/cloud/clouds/msazure.py and 5 other locations - About 1 hr to fix
          salt/cloud/clouds/ec2.py on lines 2954..2957
          salt/cloud/clouds/ec2.py on lines 4252..4255
          salt/cloud/clouds/msazure.py on lines 802..805
          salt/states/boto_iam.py on lines 1506..1509
          salt/states/boto_iot.py on lines 368..371

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

              if isinstance(kwargs['volumes'], six.string_types):
                  volumes = salt.utils.yaml.safe_load(kwargs['volumes'])
              else:
                  volumes = kwargs['volumes']
          Severity: Major
          Found in salt/cloud/clouds/msazure.py and 5 other locations - About 1 hr to fix
          salt/cloud/clouds/ec2.py on lines 2954..2957
          salt/cloud/clouds/ec2.py on lines 4252..4255
          salt/cloud/clouds/msazure.py on lines 708..711
          salt/states/boto_iam.py on lines 1506..1509
          salt/states/boto_iot.py on lines 368..371

          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

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

                  volume.setdefault("media_link",
                                    kwargs["media_link"][:-4] + "-disk-{0}.vhd".format(volume["lun"]))
          Severity: Major
          Found in salt/cloud/clouds/msazure.py and 1 other location - About 1 hr to fix
          salt/cloud/clouds/msazure.py on lines 846..847

          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

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

                  volume.setdefault("media_link",
                                    kwargs["media_link"][:-4] + "-disk-{0}.vhd".format(volume["lun"]))
          Severity: Major
          Found in salt/cloud/clouds/msazure.py and 1 other location - About 1 hr to fix
          salt/cloud/clouds/msazure.py on lines 752..753

          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

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

                          ret[service.service_name]['deployments'][deployment.name]['role_instance_list'][role_instance.role_name] = {
                              'fqdn': role_instance.fqdn,
                              'instance_error_code': role_instance.instance_error_code,
                              'instance_fault_domain': role_instance.instance_fault_domain,
                              'instance_name': role_instance.instance_name,
          Severity: Major
          Found in salt/cloud/clouds/msazure.py and 1 other location - About 1 hr to fix
          salt/modules/boto_s3_bucket.py on lines 270..280

          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

                  data = storage_conn.set_container_acl(
                      container_name=kwargs['name'],
                      signed_identifiers=kwargs.get('signed_identifiers', None),
                      x_ms_blob_public_access=kwargs.get('blob_public_access', None),
                      x_ms_lease_id=kwargs.get('lease_id', None),
          Severity: Minor
          Found in salt/cloud/clouds/msazure.py and 1 other location - About 55 mins to fix
          salt/cloud/clouds/msazure.py on lines 2607..2611

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

          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

                  storage_conn.create_container(
                      container_name=kwargs['name'],
                      x_ms_meta_name_values=kwargs.get('meta_name_values', None),
                      x_ms_blob_public_access=kwargs.get('blob_public_access', None),
                      fail_on_exist=kwargs.get('fail_on_exist', False),
          Severity: Minor
          Found in salt/cloud/clouds/msazure.py and 1 other location - About 55 mins to fix
          salt/cloud/clouds/msazure.py on lines 2826..2830

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

          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'](name, __active_provider_name__.split(':')[0], __opts__)
          Severity: Major
          Found in salt/cloud/clouds/msazure.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/gce.py on lines 2377..2378
          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/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 15 locations. Consider refactoring.
          Open

          def __virtual__():
              '''
              Check for Azure configurations.
              '''
              if get_configured_provider() is False:
          Severity: Major
          Found in salt/cloud/clouds/msazure.py and 14 other locations - About 30 mins to fix
          salt/cloud/clouds/aliyun.py on lines 90..100
          salt/cloud/clouds/cloudstack.py on lines 78..88
          salt/cloud/clouds/digitalocean.py on lines 68..78
          salt/cloud/clouds/ec2.py on lines 186..196
          salt/cloud/clouds/oneandone.py on lines 156..166
          salt/cloud/clouds/opennebula.py on lines 98..108
          salt/cloud/clouds/openstack.py on lines 248..256
          salt/cloud/clouds/profitbricks.py on lines 138..148
          salt/cloud/clouds/proxmox.py on lines 70..80
          salt/cloud/clouds/pyrax.py on lines 29..39
          salt/cloud/clouds/qingcloud.py on lines 71..81
          salt/cloud/clouds/softlayer.py on lines 55..65
          salt/cloud/clouds/softlayer_hw.py on lines 53..63
          salt/cloud/clouds/vmware.py on lines 173..183

          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