saltstack/salt

View on GitHub

Showing 9,400 of 17,590 total issues

Function _get_response_template has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    def _get_response_template(self, method_name, http_status):
        if method_name == 'options' or not self._is_http_error_rescode(http_status):
            response_templates = {'application/json': self._response_template} \
                if self._response_template else self.RESPONSE_OPTION_TEMPLATE
        else:
Severity: Minor
Found in salt/states/boto_apigateway.py - About 35 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 running has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

def running(name, **kwargs):
    r'''
    Defines and starts a new VM with specified arguments, or restart a
    VM (or group of VMs). (Runs ``vagrant up``.)

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

def _name_matches(name, matches):
    '''
    Helper function to see if given name has any of the patterns in given matches
    '''
    for m in matches:
Severity: Minor
Found in salt/states/boto_apigateway.py - About 35 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 ip_address_list_exists has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

def ip_address_list_exists(name, items):
    '''
    Ensures that an IP address list exists with the items provided.

    name: The name of the module function to execute.
Severity: Minor
Found in salt/states/bluecoat_sslv.py - About 35 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 domain_name_list_exists has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

def domain_name_list_exists(name, items):
    '''
    Ensures that a domain name list exists with the items provided.

    name: The name of the module function to execute.
Severity: Minor
Found in salt/states/bluecoat_sslv.py - About 35 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 _parallel_map has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

def _parallel_map(func, inputs):
    '''
    Applies a function to each element of a list, returning the resulting list.

    A separate thread is created for each element in the input list and the
Severity: Minor
Found in salt/states/saltmod.py - About 35 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 verify_api has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    def verify_api(self, ret):
        '''
        this method helps determine if the given stage_name is already on a deployment
        label matching the input api_name, swagger_file.

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

def present(dbname, name,
            owner=None, user=None,
            db_user=None, db_password=None,
            db_host=None, db_port=None):
    '''
Severity: Minor
Found in salt/states/postgres_schema.py - About 35 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 exists has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

def exists(
        name,
        region,
        user=None,
        opts=False):
Severity: Minor
Found in salt/states/aws_sqs.py - About 35 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 absent has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

def absent(name,
           path,
           mask,
           cmd,
           user='root'):
Severity: Minor
Found in salt/states/incron.py - About 35 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 distinguished_name_list_exists has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

def distinguished_name_list_exists(name, items):
    '''
    Ensures that a distinguished name list exists with the items provided.

    name: The name of the module function to execute.
Severity: Minor
Found in salt/states/bluecoat_sslv.py - About 35 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 connection_factory_absent has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

def connection_factory_absent(name, both=True, server=None):
    '''
    Ensures the transaction factory is absent.

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

def jdbc_datasource_absent(name, both=True, server=None):
    '''
    Ensures the JDBC Datasource doesn't exists

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

def absent(
        name,
        region,
        user=None,
        opts=False):
Severity: Minor
Found in salt/states/aws_sqs.py - About 35 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 replication_group_absent has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

def replication_group_absent(name, wait=600, region=None, key=None, keyid=None,
                             profile=None, **args):
    '''
    Ensure a given replication group is deleted.

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

def cache_cluster_absent(name, wait=600, region=None, key=None, keyid=None,
                         profile=None, **args):
    '''
    Ensure a given cache cluster is deleted.

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

def cache_parameter_group_absent(name, region=None, key=None, keyid=None, profile=None, **args):
    '''
    Ensure a given cache parameter group is absent.

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

def cache_subnet_group_absent(name, region=None, key=None, keyid=None, profile=None, **args):
    '''
    Ensure a given cache subnet group is deleted.

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

def absent(name,
           user=None,
           maintenance_db=None,
           db_password=None,
           db_host=None,
Severity: Minor
Found in salt/states/postgres_user.py - About 35 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 installed has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

def installed(name, default=False, user=None):
    '''
    Verify that the specified python is installed with pyenv. pyenv is
    installed if necessary.

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