saltstack/salt

View on GitHub

Showing 9,400 of 17,590 total issues

File pyobjects.py has 282 lines of code (exceeds 250 allowed). Consider refactoring.
Open

# -*- coding: utf-8 -*-
'''
:maintainer: Evan Borgstrom <evan@borgstrom.ca>

Pythonic object interface to creating state data, see the pyobjects renderer
Severity: Minor
Found in salt/utils/pyobjects.py - About 2 hrs to fix

    File bluecoat_sslv.py has 282 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    # -*- coding: utf-8 -*-
    '''
    Module to provide Blue Coat SSL Visibility compatibility to Salt.
    
    :codeauthor: Spencer Ervin <spencer_ervin@hotmail.com>
    Severity: Minor
    Found in salt/modules/bluecoat_sslv.py - About 2 hrs to fix

      File slsutil.py has 282 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      # -*- coding: utf-8 -*-
      '''
      Utility functions for use with or in SLS files
      '''
      
      
      Severity: Minor
      Found in salt/modules/slsutil.py - About 2 hrs to fix

        Function _read has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
        Open

            def _read(self, timeout, callback=None):
                try:
                    yield self._read_in_progress.acquire(timeout=0.00000001)
                except tornado.gen.TimeoutError:
                    raise tornado.gen.Return(None)
        Severity: Minor
        Found in salt/transport/ipc.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 list_ has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
        Open

        def list_(name, add, match, stamp=False, prune=0):
            '''
            Add the specified values to the named list
        
            If ``stamp`` is True, then the timestamp from the event will also be added
        Severity: Minor
        Found in salt/thorium/reg.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 publish has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
        Open

            def publish(self, clear_load):
                '''
                This method sends out publications to the minions, it can only be used
                by the LocalClient.
                '''
        Severity: Minor
        Found in salt/master.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 rights has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
        Open

            def rights(self, form, load):
                '''
                Determine what type of authentication is being requested and pass
                authorization
        
        
        Severity: Minor
        Found in salt/auth/__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 clean_fsbackend has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
        Open

        def clean_fsbackend(opts):
            '''
            Clean out the old fileserver backends
            '''
            # Clear remote fileserver backend caches so they get recreated
        Severity: Minor
        Found in salt/daemons/masterapi.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 deployed has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
        Open

        def deployed(name, jboss_config, salt_source=None):
            '''Ensures that the given application is deployed on server.
        
            jboss_config:
                Dict with connection properties (see state description)
        Severity: Minor
        Found in salt/states/jboss7.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 _manage_component has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
        Open

        def _manage_component(component, parent_id, defined, existing, template_id=None, **kwargs):
            '''
            Takes particular component list, compares it with existing, call appropriate API methods - create, update, delete.
        
            :param component: component name
        Severity: Minor
        Found in salt/states/zabbix_template.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 key_present has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
        Open

        def key_present(name, save_private=None, upload_public=None, region=None,
                        key=None, keyid=None, profile=None):
            '''
            Ensure key pair is present.
            '''
        Severity: Minor
        Found in salt/states/boto_ec2.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 virtual_network_present has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
        Open

        def virtual_network_present(name, address_prefixes, resource_group, dns_servers=None,
                                    tags=None, connection_auth=None, **kwargs):
            '''
            .. versionadded:: 2019.2.0
        
        
        Severity: Minor
        Found in salt/states/azurearm_network.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 network_security_group_present has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
        Open

        def network_security_group_present(name, resource_group, tags=None, security_rules=None, connection_auth=None,
                                           **kwargs):
            '''
            .. versionadded:: 2019.2.0
        
        
        Severity: Minor
        Found in salt/states/azurearm_network.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 20 (exceeds 5 allowed). Consider refactoring.
        Open

        def present(name, pipeline_objects=None,
                    pipeline_objects_from_pillars='boto_datapipeline_pipeline_objects',
                    parameter_objects=None,
                    parameter_objects_from_pillars='boto_datapipeline_parameter_objects',
                    parameter_values=None,
        Severity: Minor
        Found in salt/states/boto_datapipeline.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 _find_init_change has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
        Open

        def _find_init_change(name, ret, **kwargs):
            '''
            look for changes from any previous init of machine.
        
            :return: modified ret and kwargs
        Severity: Minor
        Found in salt/states/vagrant.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 _diff_cache_cluster has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
        Open

        def _diff_cache_cluster(current, desired):
            '''
            If you need to enhance what modify_cache_cluster() considers when deciding what is to be
            (or can be) updated, add it to 'modifiable' below.  It's a dict mapping the param as used
            in modify_cache_cluster() to that in describe_cache_clusters().  Any data fiddlery that
        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 installed has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
        Open

        def installed(name, updates=None):
            '''
            Ensure Microsoft Updates are installed. Updates will be downloaded if
            needed.
        
        
        Severity: Minor
        Found in salt/states/win_wua.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 20 (exceeds 5 allowed). Consider refactoring.
        Open

        def absent(name, bridge=None):
            '''
            Ensures that the named port exists on bridge, eventually deletes it.
            If bridge is not set, port is removed from  whatever bridge contains it.
        
        
        Severity: Minor
        Found in salt/states/openvswitch_port.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 change has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
        Open

        def change(name, context=None, changes=None, lens=None,
                load_path=None, **kwargs):
            '''
            .. versionadded:: 2014.7.0
        
        
        Severity: Minor
        Found in salt/states/augeas.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 20 (exceeds 5 allowed). Consider refactoring.
        Open

        def present(name, character_set=None, collate=None, **connection_args):
            '''
            Ensure that the named database is present with the specified properties
        
            name
        Severity: Minor
        Found in salt/states/mysql_database.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