saltstack/salt

View on GitHub

Showing 9,400 of 17,590 total issues

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

def present(name,
            type,
            url,
            access=None,
            user=None,
Severity: Minor
Found in salt/states/grafana4_datasource.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 _dict_to_name_value has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

def _dict_to_name_value(data):
    '''
    Convert a dictionary to a list of dictionaries to facilitate ordering
    '''
    if isinstance(data, dict):
Severity: Minor
Found in salt/returners/highstate_return.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 policy_detached has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

def policy_detached(name, policyName, principal,
                  region=None, key=None, keyid=None, profile=None):
    '''
    Ensure policy is attached to the given principal.

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

def _parse_template(tmpl_str):
    '''
    Parsing template
    '''
    tmpl_str = tmpl_str.strip()
Severity: Minor
Found in salt/states/heat.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 config has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

def config(name, config):
    '''
    Ensure that the marathon app with the given id is present and is configured
    to match the given config values.

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

def _fulfills_version_string(installed_versions, version_conditions_string, ignore_epoch=False, allow_updates=False):
    '''
    Returns True if any of the installed versions match the specified version conditions,
    otherwise returns False.

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

def policy_attached(name, policyName, principal,
            region=None, key=None, keyid=None, profile=None):
    '''
    Ensure policy is attached to the given principal.

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

def absent(name):
    '''
    Ensures that the named bridge does not exist, eventually deletes it.

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

def absent(name, **kwargs):
    '''
    Makes the Zabbix Template to be absent (either does not exist or delete it).

    :param name: Zabbix Template name
Severity: Minor
Found in salt/states/zabbix_template.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 update has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

def update(name,
           endpoint='incidents',
           id=None,
           api_url=None,
           page_id=None,
Severity: Minor
Found in salt/states/statuspage.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 node_label_folder_absent has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

def node_label_folder_absent(name, node, **kwargs):
    '''
    Ensures the label folder doesn't exist on the specified node.

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

def shutdown(name, message=None, timeout=5, force_close=True, reboot=False,
             in_seconds=False, only_on_pending_reboot=False):
    '''
    Shutdown the computer

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

def secret_present(
        name,
        namespace='default',
        data=None,
        source=None,
Severity: Minor
Found in salt/states/kubernetes.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 volume_attached has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

def volume_attached(name, server_name, provider=None, **kwargs):
    '''
    Check if a block volume is attached.
    '''
    ret = _check_name(name)
Severity: Minor
Found in salt/states/cloud.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 _standardize has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

def _standardize(structure):
    '''
    Return standardized format for lists/dictionaries.

    Lists of dictionaries are sorted by the value of the dictionary at
Severity: Minor
Found in salt/states/boto_datapipeline.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 enabled has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

def enabled(name, **kwargs):
    '''
    Ensure a job is enabled in the schedule

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

def disabled(name, **kwargs):
    '''
    Ensure a job is disabled in the schedule

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

def absent(name, **kwargs):
    '''
    Ensure a job is absent from the schedule

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

def present(name, auth=None, **kwargs):
    '''
    Ensure a security group rule exists

    defaults: port_range_min=None, port_range_max=None, protocol=None,
Severity: Minor
Found in salt/states/neutron_secgroup_rule.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 wheel has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

def wheel(name, **kwargs):
    '''
    Execute a wheel module on the master

    .. versionadded:: 2014.7.0
Severity: Minor
Found in salt/states/saltmod.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

Severity
Category
Status
Source
Language