saltstack/salt

View on GitHub

Showing 9,400 of 17,590 total issues

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

def endpoint_absent(name, region=None, profile=None, interface=None, **connection_args):
    '''
    Ensure that the endpoint for a service doesn't exist in Keystone catalog

    name
Severity: Minor
Found in salt/states/keystone.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 set_timeout has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

def set_timeout(name, value, power='ac', scheme=None):
    '''
    Set the sleep timeouts of specific items such as disk, monitor, etc.

    Args:
Severity: Minor
Found in salt/states/win_powercfg.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 balancer_present has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

def balancer_present(name, port, protocol, profile, algorithm=None, members=None, **libcloud_kwargs):
    '''
    Ensures a load balancer is present.

    :param name: Load Balancer name
Severity: Minor
Found in salt/states/libcloud_loadbalancer.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 node_label_present has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

def node_label_present(
        name,
        node,
        value,
        **kwargs):
Severity: Minor
Found in salt/states/kubernetes.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 key_absent has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

def key_absent(name, region=None, key=None, keyid=None, profile=None):
    '''
    Deletes a key pair
    '''
    ret = {'name': name,
Severity: Minor
Found in salt/states/boto_ec2.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 absent has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

def absent(name, protocol=None, service_address=None, server_address=None):
    '''
    Ensure the LVS Real Server in specified service is absent.

    name
Severity: Minor
Found in salt/states/lvs_server.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 user_present has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

def user_present(name, uid, password, channel=14, callback=False,
                link_auth=True, ipmi_msg=True, privilege_level='administrator', **kwargs):
    '''
    Ensure IPMI user and user privileges.

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

def absent(name, protocol=None, service_address=None):
    '''
    Ensure the LVS service is absent.

    name
Severity: Minor
Found in salt/states/lvs_service.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 _get_baseline_from_tag has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

def _get_baseline_from_tag(config, tag):
    '''
    Returns the last created baseline snapshot marked with `tag`
    '''
    last_snapshot = None
Severity: Minor
Found in salt/states/snapper.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 _rows_differ has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

def _rows_differ(row, _row):
    '''
    Check if grafana dashboard row and _row differ
    '''
    row_copy = copy.deepcopy(row)
Severity: Minor
Found in salt/states/grafana.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 _validate_int has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

def _validate_int(name, value, limits=(), strip='%'):
    '''
    Validate the named integer within the supplied limits inclusive and
    strip supplied unit characters
    '''
Severity: Minor
Found in salt/states/disk.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 _instance_profile_absent has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

def _instance_profile_absent(
        name,
        region=None,
        key=None,
        keyid=None,
Severity: Minor
Found in salt/states/boto_iam_role.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 _role_absent has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

def _role_absent(
        name,
        region=None,
        key=None,
        keyid=None,
Severity: Minor
Found in salt/states/boto_iam_role.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 _normalize_pools has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

def _normalize_pools(existing, desired):
    pools = {'existing': {4: None, 6: None},
             'desired': {4: None, 6: None}}

    for pool in existing['Config']:
Severity: Minor
Found in salt/states/docker_network.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 absent has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

def absent(name, auth=None, **kwargs):
    '''
    Ensure a security group rule does not exist

    name
Severity: Minor
Found in salt/states/neutron_secgroup_rule.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 _get_recurse_set has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

def _get_recurse_set(recurse):
    '''
    Converse *recurse* definition to a set of strings.

    Raises TypeError or ValueError when *recurse* has wrong structure.
Severity: Minor
Found in salt/states/file.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 cib_pushed has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

def cib_pushed(name, cibname, scope=None, extra_args=None):
    '''
    Ensure that a CIB-file is pushed if it is changed since the creation of it with pcs.cib_present

    Should be run on one cluster node only
Severity: Minor
Found in salt/states/pcs.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 present has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

def present(name, value, delimiter=DEFAULT_TARGET_DELIM, force=False):
    '''
    Ensure that a grain is set

    .. versionchanged:: v2015.8.2
Severity: Minor
Found in salt/states/grains.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 _check_dir_meta has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

def _check_dir_meta(name,
                    user,
                    group,
                    mode,
                    follow_symlinks=False):
Severity: Minor
Found in salt/states/file.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 absent has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

def absent(
        name,
        zone,
        record_type,
        identifier=None,
Severity: Minor
Found in salt/states/boto_route53.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

Severity
Category
Status
Source
Language