saltstack/salt

View on GitHub

Showing 9,400 of 17,590 total issues

Function find_images has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
Open

def find_images(ami_name=None, executable_by=None, owners=None, image_ids=None, tags=None,
                region=None, key=None, keyid=None, profile=None, return_objs=False):

    '''
    Given image properties, find and return matching AMI ids
Severity: Minor
Found in salt/modules/boto_ec2.py - About 3 hrs 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 has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
Open

def add(name, **kwargs):
    '''
    Add a job to the schedule

    CLI Example:
Severity: Minor
Found in salt/modules/schedule.py - About 3 hrs 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 openconfig_interfaces has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
Open

def openconfig_interfaces(device_name=None):
    '''
    .. versionadded:: 2019.2.0

    Return a dictionary structured as standardised in the
Severity: Minor
Found in salt/modules/netbox.py - About 3 hrs 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 smart_attributes has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
Open

def smart_attributes(dev, attributes=None, values=None):
    '''
    Fetch SMART attributes
    Providing attributes will deliver only requested attributes
    Providing values will deliver only requested values for attributes
Severity: Minor
Found in salt/modules/disk.py - About 3 hrs 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 skip_job has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
Open

def skip_job(name, current_time, **kwargs):
    '''
    Skip a job in the minion's schedule at specified time.

    Time to skip should be specified as date string format,
Severity: Minor
Found in salt/modules/schedule.py - About 3 hrs 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 describe_hosted_zones has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
Open

def describe_hosted_zones(zone_id=None, domain_name=None, region=None,
                          key=None, keyid=None, profile=None):
    '''
    Return detailed info about one, or all, zones in the bound account.
    If neither zone_id nor domain_name is provided, return all zones.
Severity: Minor
Found in salt/modules/boto_route53.py - About 3 hrs 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 _netstat_aix has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
Open

def _netstat_aix():
    '''
    Return netstat information for SunOS flavors
    '''
    ret = []
Severity: Minor
Found in salt/modules/network.py - About 3 hrs 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 recv_chunked has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
Open

def recv_chunked(dest, chunk, append=False, compressed=True, mode=None):
    '''
    This function receives files copied to the minion using ``salt-cp`` and is
    not intended to be used directly on the CLI.
    '''
Severity: Minor
Found in salt/modules/cp.py - About 3 hrs 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 25 (exceeds 5 allowed). Consider refactoring.
Open

def list_(prefix=None,
          bin_env=None,
          user=None,
          cwd=None,
          env_vars=None,
Severity: Minor
Found in salt/modules/pip.py - About 3 hrs 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 generateIntegers has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
Open

def generateIntegers(api_key=None,
                     api_version=None,
                     **kwargs):
    '''
    Generate random integers
Severity: Minor
Found in salt/modules/random_org.py - About 3 hrs 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 has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
Open

def add(name, beacon_data, **kwargs):
    '''
    Add a beacon on the minion

    Args:
Severity: Minor
Found in salt/modules/beacons.py - About 3 hrs 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 super_ has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
Open

def super_(dev):
    '''
    Read out BCache SuperBlock

    CLI example:
Severity: Minor
Found in salt/modules/bcache.py - About 3 hrs 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_flags_from_package_conf has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
Open

def get_flags_from_package_conf(conf, atom):
    '''
    Get flags for a given package or DEPEND atom.
    Warning: This only works if the configuration files tree is in the correct
    format (the one enforced by enforce_nice_config)
Severity: Minor
Found in salt/modules/portage_config.py - About 3 hrs 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 conf has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
Open

def conf():
    '''
    Parse GRUB conf file

    CLI Example:
Severity: Minor
Found in salt/modules/grub_legacy.py - About 3 hrs 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_domain_caps has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
Open

def _parse_domain_caps(caps):
    '''
    Parse the XML document of domain capabilities into a structure.
    Return the domain capabilities given an emulator, architecture, machine or virtualization type.

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

def _parse_caps_host(host):
    '''
    Parse the <host> element of the connection capabilities XML.
    '''
    result = {}
Severity: Minor
Found in salt/modules/virt.py - About 3 hrs 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 info has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
Open

def info(*packages, **kwargs):
    '''
    Returns a detailed summary of package information for provided package names.
    If no packages are specified, all packages will be returned.

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

def trust_key(keyid=None,
              fingerprint=None,
              trust_level=None,
              user=None):
    '''
Severity: Minor
Found in salt/modules/gpg.py - About 3 hrs 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 info has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
Open

def info(name):
    '''
    Return user information

    Args:
Severity: Minor
Found in salt/modules/win_useradd.py - About 3 hrs 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_base has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
Open

def merge_base(cwd,
               refs=None,
               octopus=False,
               is_ancestor=False,
               independent=False,
Severity: Minor
Found in salt/modules/git.py - About 3 hrs 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