saltstack/salt

View on GitHub

Showing 9,400 of 17,590 total issues

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

def _connect(**kwargs):
    '''
    Initialise netscaler connection
    '''
    connargs = dict()
Severity: Minor
Found in salt/modules/netscaler.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 delete_nat_gateway has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
Open

def delete_nat_gateway(nat_gateway_id,
                       release_eips=False, region=None,
                       key=None, keyid=None, profile=None,
                       wait_for_delete=False, wait_for_delete_retries=5):
    '''
Severity: Minor
Found in salt/modules/boto_vpc.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 _get_pkg_info has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
Open

def _get_pkg_info(*packages, **kwargs):
    '''
    Return list of package information. If 'packages' parameter is empty,
    then data about all installed packages will be returned.

Severity: Minor
Found in salt/modules/dpkg_lowpkg.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 pkg has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
Open

def pkg(pkg_path,
        pkg_sum,
        hash_type,
        test=None,
        **kwargs):
Severity: Minor
Found in salt/modules/state.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 info_installed has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
Open

def info_installed(*names, **kwargs):
    '''
    Return the information of the named package(s), installed on the system.

    :param names:
Severity: Minor
Found in salt/modules/zypperpkg.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 showconfig has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
Open

def showconfig(name, default=False, dict_return=False):
    '''
    Show the configuration options for a given port.

    default : False
Severity: Minor
Found in salt/modules/freebsdports.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 _apply_dvs_infrastructure_traffic_resources has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
Open

def _apply_dvs_infrastructure_traffic_resources(infra_traffic_resources,
                                                resource_dicts):
    '''
    Applies the values of the resource dictionaries to infra traffic resources,
    creating the infra traffic resource if required
Severity: Minor
Found in salt/modules/vsphere.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 _setup_conn_old has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
Open

def _setup_conn_old(**kwargs):
    '''
    Setup kubernetes API connection singleton the old way
    '''
    host = __salt__['config.option']('kubernetes.api_url',
Severity: Minor
Found in salt/modules/kubernetesmod.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 _apply_policy_config has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
Open

def _apply_policy_config(policy_spec, policy_dict):
    '''Applies a policy dictionary to a policy spec'''
    log.trace('policy_dict = %s', policy_dict)
    if policy_dict.get('name'):
        policy_spec.name = policy_dict['name']
Severity: Minor
Found in salt/modules/vsphere.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 update_cluster has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
Open

def update_cluster(cluster_dict, datacenter=None, cluster=None,
                   service_instance=None):
    '''
    Updates a cluster.

Severity: Minor
Found in salt/modules/vsphere.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 _create_adapter_type has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
Open

def _create_adapter_type(network_adapter, adapter_type,
                         network_adapter_label=''):
    '''
    Returns a vim.vm.device.VirtualEthernetCard object specifying a virtual
    ethernet card information
Severity: Minor
Found in salt/modules/vsphere.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 agent_check_register has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
Open

def agent_check_register(consul_url=None, token=None, **kwargs):
    '''
    The register endpoint is used to add a new check to the local agent.

    :param consul_url: The Consul server URL.
Severity: Minor
Found in salt/modules/consul.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 list_users has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
Open

def list_users():
    '''
    List all DRAC users

    CLI Example:
Severity: Minor
Found in salt/modules/drac.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 list_sites has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
Open

def list_sites():
    '''
    List all the currently deployed websites.

    Returns:
Severity: Minor
Found in salt/modules/win_iis.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 get has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
Open

def get(consul_url=None, key=None, token=None, recurse=False, decode=False, raw=False):
    '''
    Get key from Consul

    :param consul_url: The Consul server URL.
Severity: Minor
Found in salt/modules/consul.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 info_installed has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
Open

def info_installed(*names, **kwargs):
    '''
    .. versionadded:: 2015.8.1

    Return the information of the named package(s), installed on the system.
Severity: Minor
Found in salt/modules/yumpkg.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 map_providers_parallel has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
Open

    def map_providers_parallel(self, query='list_nodes', cached=False):
        '''
        Return a mapping of what named VMs are running on what VM providers
        based on what providers are defined in the configuration and VMs

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

def avail_locations(conn=None, call=None):
    '''
    Return a dict of all available VM locations on the cloud provider with
    relevant data
    '''
Severity: Minor
Found in salt/cloud/libcloudfuncs.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 17 (exceeds 5 allowed). Consider refactoring.
Open

def destroy(name, conn=None, call=None):
    '''
    Delete a single VM
    '''
    if call == 'function':
Severity: Minor
Found in salt/cloud/libcloudfuncs.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 remove has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
Open

def remove(name=None, pkgs=None, **kwargs):  # pylint: disable=W0613
    '''
    .. versionchanged:: 2015.8.12,2016.3.3,2016.11.0
        On minions running systemd>=205, `systemd-run(1)`_ is now used to
        isolate commands which modify installed packages from the
Severity: Minor
Found in salt/modules/yumpkg.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

Severity
Category
Status
Source
Language