saltstack/salt

View on GitHub

Showing 9,400 of 17,590 total issues

Function start has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

def start(uri=None,
          tag_prefix='salt/engines/libvirt_events',
          filters=None):
    '''
    Listen to libvirt events and forward them to salt.
Severity: Minor
Found in salt/engines/libvirt_events.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 can_user_run has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

    def can_user_run(self, user, command, groups):
        '''
        Break out the permissions into the following:

        Check whether a user is in any group, including whether a group has the '*' membership
Severity: Minor
Found in salt/engines/slack.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_stack has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

def delete_stack(name=None, poll=0, timeout=60, profile=None):
    '''
    Delete a stack (heat stack-delete)

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

def get_milestone(number=None,
                  name=None,
                  repo_name=None,
                  profile='github',
                  output='min'):
Severity: Minor
Found in salt/modules/github.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_prs has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

def get_prs(repo_name=None,
            profile='github',
            state='open',
            head=None,
            base=None,
Severity: Minor
Found in salt/modules/github.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 set_dns has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

def set_dns(name, dnsservers=None, searchdomains=None, path=None):
    '''
    .. versionchanged:: 2015.5.0
        The ``dnsservers`` and ``searchdomains`` parameters can now be passed
        as a comma-separated list.
Severity: Minor
Found in salt/modules/lxc.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 _run has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

def _run(name,
         cmd,
         output=None,
         no_start=False,
         preserve_state=True,
Severity: Minor
Found in salt/modules/lxc.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_lxc_default_data has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

def _get_lxc_default_data(**kwargs):
    kwargs = copy.deepcopy(kwargs)
    ret = {}
    for k in ['utsname', 'rootfs']:
        val = kwargs.get(k, None)
Severity: Minor
Found in salt/modules/lxc.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 check_password has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

def check_password(name, password, runas=None):
    '''
    .. versionadded:: 2016.3.0

    Checks if a user's password is valid.
Severity: Minor
Found in salt/modules/rabbitmq.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 _change_state has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

def _change_state(cmd,
                  name,
                  expected,
                  stdin=_marker,
                  stdout=_marker,
Severity: Minor
Found in salt/modules/lxc.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 add_veth has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

def add_veth(name, interface_name, bridge=None, path=None):
    '''
    Add a veth to a container.
    Note : this function doesn't update the container config, just add the interface at runtime

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

def running_systemd(name, cache=True, path=None):
    '''
    Determine if systemD is running

    path
Severity: Minor
Found in salt/modules/lxc.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 sync has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

def sync():
    '''
    Sync portage/overlay trees and update the eix database

    CLI Example:
Severity: Minor
Found in salt/modules/eix.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_function_code has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

def update_function_code(FunctionName, ZipFile=None, S3Bucket=None, S3Key=None,
                         S3ObjectVersion=None, Publish=False,
                         region=None, key=None, keyid=None, profile=None):
    '''
    Upload the given code to the named lambda function.
Severity: Minor
Found in salt/modules/boto_lambda.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 list_pkgs has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

def list_pkgs(versions_as_list=False, **kwargs):
    '''
    List the packages currently installed in a dict::

        {'<package_name>': '<version>'}
Severity: Minor
Found in salt/modules/mac_portspkg.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 del_repo_key has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

def del_repo_key(name=None, **kwargs):
    '''
    .. versionadded:: 2015.8.0

    Remove a repo key using ``apt-key del``
Severity: Minor
Found in salt/modules/aptpkg.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_subnet_group has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

def get_cache_subnet_group(name, region=None, key=None, keyid=None,
                           profile=None):
    '''
    Get information about a cache subnet group.

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

def delete_objects(Bucket, Delete, MFA=None, RequestPayer=None,
                   region=None, key=None, keyid=None, profile=None):
    '''
    Delete objects in a given S3 bucket.

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

def __format_value(key, value, ds_attributes):
    type_ = ds_attributes[key]['type']
    if type_ == 'BOOLEAN':
        if value in ('true', 'false'):
            return value
Severity: Minor
Found in salt/modules/jboss7.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 list_repo_pkgs has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

def list_repo_pkgs(*args, **kwargs):  # pylint: disable=unused-import
    '''
    .. versionadded:: 2017.7.0

    Returns all available packages. Optionally, package names (and name globs)
Severity: Minor
Found in salt/modules/aptpkg.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