saltstack/salt

View on GitHub

Showing 9,400 of 17,590 total issues

Function manage_pool has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

def manage_pool(hostname, username, password, name,
                allow_nat=None,
                allow_snat=None,
                description=None,
                gateway_failsafe_device=None,
Severity: Minor
Found in salt/states/bigip.py - About 1 hr 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 pipeline_absent has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

def pipeline_absent(name):
    '''
    Ensure that the named pipeline is absent

    name
Severity: Minor
Found in salt/states/elasticsearch.py - About 1 hr 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 search_template_absent has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

def search_template_absent(name):
    '''
    Ensure that the search template is absent

    name
Severity: Minor
Found in salt/states/elasticsearch.py - About 1 hr 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 primary_suffix has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

def primary_suffix(name,
        suffix=None,
        updates=False):
    '''
    .. versionadded:: 2014.7.0
Severity: Minor
Found in salt/states/win_dns_client.py - About 1 hr 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 10 (exceeds 5 allowed). Consider refactoring.
Open

def absent(name,
           user='root',
           identifier=False,
           special=None,
           **kwargs):
Severity: Minor
Found in salt/states/cron.py - About 1 hr 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 _acl_exists has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

def _acl_exists(name=None, id=None, token=None, consul_url=None):
    '''
       Check the acl exists by using the name or the ID,
       name is ignored if ID is specified,
       if only Name is used the ID associated with it is returned
Severity: Minor
Found in salt/states/consul.py - About 1 hr 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 10 (exceeds 5 allowed). Consider refactoring.
Open

def absent(name=None, start_addr=None, end_addr=None, data=None, **api_opts):
    '''
    Ensure the range is removed

    Supplying the end of the range is optional.
Severity: Minor
Found in salt/states/infoblox_range.py - About 1 hr 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_object has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

def _get_object(objname, objtype):
    '''
    Helper function to retrieve objtype from pillars if objname
    is string_types, used for SupportedLoginProviders and
    OpenIdConnectProviderARNs.
Severity: Minor
Found in salt/states/boto_cognitoidentity.py - About 1 hr 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 10 (exceeds 5 allowed). Consider refactoring.
Open

def absent(name,
           runas=None):
    '''
    Ensure the named user is absent

Severity: Minor
Found in salt/states/rabbitmq_user.py - About 1 hr 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 10 (exceeds 5 allowed). Consider refactoring.
Open

def disabled(name):
    '''
    Ensure an Apache module is disabled.

    .. versionadded:: 2016.3.0
Severity: Minor
Found in salt/states/apache_module.py - About 1 hr 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 account_policy has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

def account_policy(name=None, allow_users_to_change_password=None,
                   hard_expiry=None, max_password_age=None,
                   minimum_password_length=None, password_reuse_prevention=None,
                   require_lowercase_characters=None, require_numbers=None,
                   require_symbols=None, require_uppercase_characters=None,
Severity: Minor
Found in salt/states/boto_iam.py - About 1 hr 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 rule_absent has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

def rule_absent(name,
                method,
                port=None,
                proto='tcp',
                direction='in',
Severity: Minor
Found in salt/states/csf.py - About 1 hr 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_global_secondary_indexes has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

def _update_global_secondary_indexes(ret, changes_old, changes_new, comments, existing_index_names,
                                     provisioned_gsi_config, gsi_config, name, region, key,
                                     keyid, profile):
    '''Updates ret iff there was a failure or in test mode.'''
    try:
Severity: Minor
Found in salt/states/boto_dynamodb.py - About 1 hr 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 playbooks has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

def playbooks(name, rundir=None, git_repo=None, git_kwargs=None, ansible_kwargs=None):
    '''
    Run Ansible Playbooks

    :param name: path to playbook. This can be relative to rundir or the git repo
Severity: Minor
Found in salt/states/ansiblegate.py - About 1 hr 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_key has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

def _delete_key(ret, access_key_id, user_name, region=None, key=None, keyid=None, profile=None):
    keys = __salt__['boto_iam.get_all_access_keys'](user_name=user_name, region=region, key=key,
                                                    keyid=keyid, profile=profile)
    log.debug('Keys for user %s are : %s.', keys, user_name)
    if isinstance(keys, six.string_types):
Severity: Minor
Found in salt/states/boto_iam.py - About 1 hr 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 managed has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

def managed(name, config=None, defaults=None):

    '''
    Configures the SNMP on the device as specified in the SLS file.

Severity: Minor
Found in salt/states/netsnmp.py - About 1 hr 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 _merge_extra_filerefs has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

def _merge_extra_filerefs(*args):
    '''
    Takes a list of filerefs and returns a merged list
    '''
    ret = []
Severity: Minor
Found in salt/client/ssh/wrapper/state.py - About 1 hr 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 shim_cmd has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    def shim_cmd(self, cmd_str, extension='py'):
        '''
        Run a shim command.

        If tty is enabled, we must scp the shim to the target system and
Severity: Minor
Found in salt/client/ssh/__init__.py - About 1 hr 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_cache_returns has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    def get_cache_returns(self, jid):
        '''
        Execute a single pass to gather the contents of the job cache
        '''
        ret = {}
Severity: Minor
Found in salt/client/__init__.py - About 1 hr 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 has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

def option(
        value,
        default='',
        omit_opts=False,
        omit_master=False,
Severity: Minor
Found in salt/client/ssh/wrapper/config.py - About 1 hr 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