saltstack/salt

View on GitHub

Showing 9,400 of 17,590 total issues

Function present has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
Open

def present(profile='pagerduty', subdomain=None, api_key=None, **kwargs):
    '''
    Ensure that a pagerduty escalation policy exists.  Will create or update as needed.

    This method accepts as args everything defined in
Severity: Minor
Found in salt/states/pagerduty_escalation_policy.py - About 2 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 _install_indv_pkg has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
Open

    def _install_indv_pkg(self, pkg_name, pkg_file):
        '''
        Install one individual package
        '''
        self.ui.status('... installing {0}'.format(pkg_name))
Severity: Minor
Found in salt/spm/__init__.py - About 2 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 uptodate has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
Open

def uptodate(name, refresh=False, pkgs=None, **kwargs):
    '''
    .. versionadded:: 2014.7.0
    .. versionchanged:: 2018.3.0

Severity: Minor
Found in salt/states/pkg.py - About 2 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 installed has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
Open

def installed(name, nodataset=False, brand_opts=None):
    '''
    Ensure zone is installed

    name : string
Severity: Minor
Found in salt/states/zone.py - About 2 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 booted has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
Open

def booted(name, single=False):
    '''
    Ensure zone is booted

    name : string
Severity: Minor
Found in salt/states/zone.py - About 2 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 route53_alias_present has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
Open

def route53_alias_present(name, region=None, key=None, keyid=None, profile=None, **kwargs):
    '''
    Ensure a Route53 Alias exists and is pointing at the given CloudFront
    distribution. An ``A`` record is always created, and if IPV6 is enabled on
    the given distribution, an ``AAAA`` record will be created as well. Also be
Severity: Minor
Found in salt/states/boto_cloudfront.py - About 2 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 installed has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
Open

def installed(name,
              features=None,
              recurse=False,
              restart=False,
              source=None,
Severity: Minor
Found in salt/states/win_servermanager.py - About 2 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 deploy_models has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
Open

    def deploy_models(self, ret):
        '''
        Method to deploy swagger file's definition objects and associated schema to AWS Apigateway as Models

        ret
Severity: Minor
Found in salt/states/boto_apigateway.py - About 2 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 promoted has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
Open

def promoted(name):
    '''
    ensure a dataset is not a clone

    name : string
Severity: Minor
Found in salt/states/zfs.py - About 2 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 cache_subnet_group_present has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
Open

def cache_subnet_group_present(name, subnets=None, region=None, key=None, keyid=None, profile=None,
                               **args):
    '''
    Ensure cache subnet group exists.

Severity: Minor
Found in salt/states/boto3_elasticache.py - About 2 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 enabled has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
Open

def enabled(name='allprofiles'):
    '''
    Enable all the firewall profiles (Windows only)

    Args:
Severity: Minor
Found in salt/states/win_firewall.py - About 2 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 disabled has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
Open

def disabled(name='allprofiles'):
    '''
    Disable all the firewall profiles (Windows only)

    Args:
Severity: Minor
Found in salt/states/win_firewall.py - About 2 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 assign_templates has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
Open

def assign_templates(host, templates, **kwargs):
    '''
    Ensures that templates are assigned to the host.

    .. versionadded:: 2017.7.0
Severity: Minor
Found in salt/states/zabbix_host.py - About 2 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 present has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
Open

def present(name,
            grant=None,
            database=None,
            user=None,
            host='localhost',
Severity: Minor
Found in salt/states/mysql_grants.py - About 2 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 managed has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
Open

def managed(name, peers=None, servers=None):

    '''
    Manages the configuration of NTP peers and servers on the device, as specified in the state SLS file.
    NTP entities not specified in these lists will be removed whilst entities not configured on the device will be set.
Severity: Minor
Found in salt/states/netntp.py - About 2 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 set_ has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
Open

def set_(name, key, value, setting=None, conf_file=_DEFAULT_CONF):
    '''
    Set a new value for a specific configuration line.

    :param str key: The command or block to configure.
Severity: Minor
Found in salt/states/logrotate.py - About 2 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 check_pillar has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
Open

def check_pillar(name,
        present=None,
        boolean=None,
        integer=None,
        string=None,
Severity: Minor
Found in salt/states/test.py - About 2 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 absent has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
Open

def absent(name, **kwargs):
    '''
    This function deletes the specified repo on the system, if it exists. It
    is essentially a wrapper around pkg.del_repo.

Severity: Minor
Found in salt/states/pkgrepo.py - About 2 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 pool_running has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
Open

def pool_running(name,
                 ptype=None,
                 target=None,
                 permissions=None,
                 source=None,
Severity: Minor
Found in salt/states/virt.py - About 2 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 row_absent has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
Open

def row_absent(name, db, table, where_sql, where_args=None):
    '''
    Makes sure the specified row is absent in db.  If multiple rows
    match where_sql, then the state will fail.

Severity: Minor
Found in salt/states/sqlite3.py - About 2 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