saltstack/salt

View on GitHub

Showing 9,400 of 17,590 total issues

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

def service_add(service_rootid=None, service_name=None, triggerid=None, **kwargs):
    '''
    .. versionadded:: Fluorine

    Create service under service with id specified as parameter.
Severity: Minor
Found in salt/modules/zabbix.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 mediatype_get has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

def mediatype_get(name=None, mediatypeids=None, **kwargs):
    '''
    Retrieve mediatypes according to the given parameters.

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

def service_get(service_name=None, service_rootid=None, **kwargs):
    '''
    .. versionadded:: Fluorine

    Get service according to name and parent service ID.
Severity: Minor
Found in salt/modules/zabbix.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 host_create has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

def host_create(host, groups, interfaces, **kwargs):
    '''
    .. versionadded:: 2016.3.0

    Create new host
Severity: Minor
Found in salt/modules/zabbix.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 get_system_info has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

def get_system_info():
    '''
    Get system information.

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

def route_filter_rule_create_or_update(name, access, communities, route_filter, resource_group, **kwargs):
    '''
    .. versionadded:: 2019.2.0

    Create or update a rule within a specified route filter.
Severity: Minor
Found in salt/modules/azurearm_network.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 user_get has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

def user_get(user_id=None, name=None, profile=None, **connection_args):
    '''
    Return a specific users (keystone user-get)

    CLI Examples:
Severity: Minor
Found in salt/modules/keystone.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 upgrade has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

def upgrade(name,
            version=None,
            source=None,
            force=False,
            pre_versions=False,
Severity: Minor
Found in salt/modules/chocolatey.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 subscribe has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

def subscribe(TopicArn=None, Protocol=None, Endpoint=None,
              region=None, key=None, keyid=None, profile=None, **kwargs):
    '''
    Subscribe to a Topic.

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

def version(name, check_remote=False, source=None, pre_versions=False):
    '''
    Instructs Chocolatey to check an installed package version, and optionally
    compare it to one available from a remote feed.

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

def subnet_create_or_update(name, address_prefix, virtual_network, resource_group, **kwargs):
    '''
    .. versionadded:: 2019.2.0

    Create or update a subnet.
Severity: Minor
Found in salt/modules/azurearm_network.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 check_db has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

def check_db(*names, **kwargs):
    '''
    .. versionadded:: 0.17.0

    Returns a dict containing the following information for each specified
Severity: Minor
Found in salt/modules/ebuildpkg.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 get_attribute has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

def get_attribute(attribute, instance_name=None, instance_id=None, region=None, key=None,
                  keyid=None, profile=None, filters=None):
    '''
    Get an EC2 instance attribute.

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

def create_circuit(name, provider_id, circuit_type, description=None):
    '''
    .. versionadded:: 2019.2.0

    Create a new Netbox circuit
Severity: Minor
Found in salt/modules/netbox.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 depclean has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

def depclean(name=None, slot=None, fromrepo=None, pkgs=None):
    '''
    Portage has a function to remove unused dependencies. If a package
    is provided, it will only removed the package if no other package
    depends on it.
Severity: Minor
Found in salt/modules/ebuildpkg.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 _del_repo_from_file has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

def _del_repo_from_file(repo, filepath):
    '''
    Remove a repo from filepath
    '''
    with salt.utils.files.fopen(filepath) as fhandle:
Severity: Minor
Found in salt/modules/opkg.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 latest_version has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

def latest_version(*names, **kwargs):
    '''
    Return the latest version of the named package available for upgrade or
    installation. If more than one package name is specified, a dict of
    name/version pairs is returned.
Severity: Minor
Found in salt/modules/opkg.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 timeoutDecorator has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

def timeoutDecorator(function):
    @wraps(function)
    def wrapper(*args, **kwargs):
        if 'dev_timeout' in kwargs:
            conn = __proxy__['junos.conn']()
Severity: Minor
Found in salt/modules/junos.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 __virtual__ has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

def __virtual__():
    '''
    Confirm this module is on a nilrt based system
    '''
    if __grains__.get('os_family') == 'NILinuxRT':
Severity: Minor
Found in salt/modules/opkg.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 port_create_vlan has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

def port_create_vlan(br, port, id, internal=False):
    '''
    Isolate VM traffic using VLANs.

    Args:
Severity: Minor
Found in salt/modules/openvswitch.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