saltstack/salt

View on GitHub

Showing 9,400 of 17,590 total issues

Function _is_error has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    def _is_error(self):
        '''
        Is this is an error code?

        :return:
Severity: Minor
Found in salt/modules/zypperpkg.py - About 25 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_configmap has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

def create_configmap(
        name,
        namespace,
        data,
        source=None,
Severity: Minor
Found in salt/modules/kubernetesmod.py - About 25 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_supervisorctl_bin has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

def _get_supervisorctl_bin(bin_env):
    '''
    Return supervisorctl command to call, either from a virtualenv, an argument
    passed in, or from the global modules options
    '''
Severity: Minor
Found in salt/modules/supervisord.py - About 25 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 agent_leave has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

def agent_leave(consul_url=None, token=None, node=None):
    '''
    Used to instruct the agent to force a node into the left state.

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

def _parse_btrfs_info(data):
    '''
    Parse BTRFS device info data.
    '''
    ret = {}
Severity: Minor
Found in salt/modules/btrfs.py - About 25 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_container_setting has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

def get_container_setting(name, container, settings):
    '''
    Get the value of the setting for the IIS container.

    .. versionadded:: 2016.11.0
Severity: Minor
Found in salt/modules/win_iis.py - About 25 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 list_ has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

def list_(consul_url=None, token=None, key=None, **kwargs):
    '''
    List keys in Consul

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

def acl_clone(consul_url=None, token=None, **kwargs):
    '''
    Information about an ACL token.

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

def catalog_service(consul_url=None, token=None, service=None, **kwargs):
    '''
    Information about the registered service.

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

def remove_lock(packages, root=None, **kwargs):  # pylint: disable=unused-argument
    '''
    Remove specified package lock.

    root
Severity: Minor
Found in salt/modules/zypperpkg.py - About 25 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 has_value has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

def has_value(key, value=None):
    '''
    Determine whether the key exists in the current salt process
    environment dictionary. Optionally compare the current value
    of the environment against the supplied value string.
Severity: Minor
Found in salt/modules/environ.py - About 25 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 list_backups has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

def list_backups():
    r'''
    List the IIS Configuration Backups on the System.

    .. versionadded:: 2017.7.0
Severity: Minor
Found in salt/modules/win_iis.py - About 25 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 health_state has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

def health_state(consul_url=None, token=None, state=None, **kwargs):
    '''
    Returns the checks in the state provided on the path.

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

def agent_check_deregister(consul_url=None, token=None, checkid=None):
    '''
    The agent will take care of deregistering the check from the Catalog.

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

def agent_service_deregister(consul_url=None, token=None, serviceid=None):
    '''
    Used to remove a service.

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

def resize(mountpoint, size):
    '''
    Resize filesystem.

    General options:
Severity: Minor
Found in salt/modules/btrfs.py - About 25 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 acl_delete has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

def acl_delete(consul_url=None, token=None, **kwargs):
    '''
    Delete an ACL token.

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

def _split_rules(rules):
    '''
    Split rules with combined grants into individual rules.

    Amazon returns a set of rules with the same protocol, from and to ports
Severity: Minor
Found in salt/modules/boto_secgroup.py - About 25 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 recover_all has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

def recover_all(lbn, profile='default'):
    '''
    Set the all the workers in lbn to recover and activate them if they are not

    CLI Examples:
Severity: Minor
Found in salt/modules/modjk.py - About 25 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 associate_profile_to_role has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

def associate_profile_to_role(profile_name, role_name, region=None, key=None,
                              keyid=None, profile=None):
    '''
    Associate an instance profile with an IAM role.

Severity: Minor
Found in salt/modules/boto_iam.py - About 25 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