saltstack/salt

View on GitHub

Showing 9,400 of 17,590 total issues

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

def connect_host(kwargs=None, call=None):
    '''
    Connect the specified host system in this VMware environment

    CLI Example:
Severity: Minor
Found in salt/cloud/clouds/vmware.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 disconnect_host has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

def disconnect_host(kwargs=None, call=None):
    '''
    Disconnect the specified host system in this VMware environment

    CLI Example:
Severity: Minor
Found in salt/cloud/clouds/vmware.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 enter_maintenance_mode has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

def enter_maintenance_mode(kwargs=None, call=None):
    '''
    To put the specified host system in maintenance mode in this VMware environment

    CLI Example:
Severity: Minor
Found in salt/cloud/clouds/vmware.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 _clean_create_kwargs has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

def _clean_create_kwargs(**kwargs):
    '''
    Sanatize kwargs to be sent to create_server
    '''
    VALID_OPTS = {
Severity: Minor
Found in salt/cloud/clouds/openstack.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 list_nodes_full has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

def list_nodes_full(call=None):
    '''
    List the nodes, ask all 'vagrant' minions, return dict of grains (enhanced).

    CLI Example:
Severity: Minor
Found in salt/cloud/clouds/vagrant.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_clonespec_for_valid_snapshot has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

def get_clonespec_for_valid_snapshot(config_spec, object_ref, reloc_spec, template, vm_):
    '''
    return clonespec only if values are valid
    '''
    moving = True
Severity: Minor
Found in salt/cloud/clouds/vmware.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 _wait_for_completion has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

def _wait_for_completion(conn, wait_timeout, server_id):
    '''
    Poll request status until resource is provisioned.
    '''
    wait_timeout = time.time() + wait_timeout
Severity: Minor
Found in salt/cloud/clouds/oneandone.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_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_image has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

def show_image(kwargs, call=None):
    '''
    Show the details from QingCloud concerning an image.

    CLI Examples:
Severity: Minor
Found in salt/cloud/clouds/qingcloud.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 _query has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

def _query(action=None,
           command=None,
           args=None,
           method='GET',
           header_dict=None,
Severity: Minor
Found in salt/cloud/clouds/gogrid.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

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

def post_dns_record(**kwargs):
    '''
    Creates a DNS record for the given name if the domain is managed with DO.
    '''
    if 'kwargs' in kwargs:  # flatten kwargs if called via salt-cloud -f
Severity: Minor
Found in salt/cloud/clouds/digitalocean.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 query has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

def query(method='droplets', droplet_id=None, command=None, args=None, http_method='get'):
    '''
    Make a web call to DigitalOcean
    '''
    base_path = six.text_type(config.get_cloud_config_value(
Severity: Minor
Found in salt/cloud/clouds/digitalocean.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 _compute_signature has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

def _compute_signature(parameters, access_key_secret):
    '''
    Generate aliyun request signature
    '''

Severity: Minor
Found in salt/cloud/clouds/aliyun.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 _wait_for_status has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

def _wait_for_status(linode_id, status=None, timeout=300, quiet=True):
    '''
    Wait for a certain status from Linode.

    linode_id
Severity: Minor
Found in salt/cloud/clouds/linode.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 avail_images has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

def avail_images(kwargs=None, call=None):
    '''
    Return a list of the images that are on the provider
    '''
    if call == 'action':
Severity: Minor
Found in salt/cloud/clouds/aliyun.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 take_action has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

def take_action(name=None, call=None, command=None, data=None, method='GET',
                location=DEFAULT_LOCATION):

    '''
    take action call used by start,stop, reboot
Severity: Minor
Found in salt/cloud/clouds/joyent.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 list_monitor_data has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

def list_monitor_data(kwargs=None, call=None):
    '''
    Get monitor data of the instance. If instance name is
    missing, will show all the instance monitor data on the region.

Severity: Minor
Found in salt/cloud/clouds/aliyun.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 _lookup_proxmox_task has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

def _lookup_proxmox_task(upid):
    '''
    Retrieve the (latest) logs and retrieve the status for a UPID.
    This can be used to verify whether a task has completed.
    '''
Severity: Minor
Found in salt/cloud/clouds/proxmox.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

Severity
Category
Status
Source
Language