saltstack/salt

View on GitHub

Showing 9,400 of 17,590 total issues

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

def enabled(name, **kwargs):
    '''
    Enable a beacon.

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

def _virt_call(domain, function, section, comment,
               connection=None, username=None, password=None, **kwargs):
    '''
    Helper to call the virt functions. Wildcards supported.

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

def installed(name,
              composer=None,
              php=None,
              user=None,
              prefer_source=None,
Severity: Minor
Found in salt/states/composer.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 modify_profile has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

def modify_profile(hostname, username, password, profile_type, name, **kwargs):
    '''
    Modify an existing profile.  If it does exists, only
    the parameters specified will be enforced.

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

def set_file(name, source, template=None, context=None, defaults=None, **kwargs):
    '''
    Set debconf selections from a file or a template

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

def modify_monitor(hostname, username, password, monitor_type, name, **kwargs):
    '''
    Modify an existing monitor.  If it does exists, only
    the parameters specified will be enforced.

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

def create_monitor(hostname, username, password, monitor_type, name, **kwargs):
    '''
    A function to connect to a bigip device and create a monitor.

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

def _load_config():
    '''
    Loads and parses /usbkey/config
    '''
    config = {}
Severity: Minor
Found in salt/states/smartos.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 package_removed has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

def package_removed(name, image=None, restart=False):
    '''
    Uninstall a package

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

def package_installed(name,
                      ignore_check=False,
                      prevent_pending=False,
                      image=None,
                      restart=False):
Severity: Minor
Found in salt/states/win_dism.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 edit_config has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

def edit_config(name, xpath=None, value=None, commit=False):
    '''
    Edits a Palo Alto XPATH to a specific value. This will always overwrite the existing value, even if it is not
    changed.

Severity: Minor
Found in salt/states/panos.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 Value map to be absent (either does not exist or delete it).

    :param name: Zabbix Value map name
Severity: Minor
Found in salt/states/zabbix_valuemap.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):
    '''
    Ensure a user does not exist on the Dell DRAC

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

def key_present(
        name,
        policy,
        description=None,
        key_usage=None,
Severity: Minor
Found in salt/states/boto_kms.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 subnet exists and is up-to-date

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

def _key_rotation(key_metadata, key_rotation, region, key, keyid, profile):
    ret = {'result': True, 'comment': '', 'changes': {}}
    kms_key_id = key_metadata['KeyId']
    rke = __salt__['boto_kms.get_key_rotation_status'](
        kms_key_id, region, key, keyid, profile
Severity: Minor
Found in salt/states/boto_kms.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, password, permission):
    '''
    Ensure the user exists on the Dell DRAC

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

def option_present(name, value, reload=False):
    '''
    Ensure the state of a particular option/setting in csf.

    name
Severity: Minor
Found in salt/states/csf.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, purge=False, force=False):
    '''
    Ensure that the named user is absent

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

def uninstalled(name, password, keychain="/Library/Keychains/System.keychain", keychain_password=None):
    '''
    Uninstall a p12 certificate file from the macOS keychain

    name
Severity: Minor
Found in salt/states/mac_keychain.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