saltstack/salt

View on GitHub

Showing 9,400 of 17,590 total issues

File cassandra_cql_return.py has 335 lines of code (exceeds 250 allowed). Consider refactoring.
Open

# -*- coding: utf-8 -*-
'''
Return data to a cassandra server

.. versionadded:: 2015.5.0
Severity: Minor
Found in salt/returners/cassandra_cql_return.py - About 4 hrs to fix

    File virtualbox.py has 333 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    # -*- coding: utf-8 -*-
    '''
    A salt cloud provider that lets you use virtualbox on your machine
    and act as a cloud.
    
    
    Severity: Minor
    Found in salt/cloud/clouds/virtualbox.py - About 4 hrs to fix

      File zabbix_user.py has 332 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      # -*- coding: utf-8 -*-
      '''
      Management of Zabbix users.
      
      :codeauthor: Jiri Kotlin <jiri.kotlin@ultimum.io>
      Severity: Minor
      Found in salt/states/zabbix_user.py - About 4 hrs to fix

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

        # -*- coding: utf-8 -*-
        '''
        Python renderer that includes a Pythonic Object based interface
        
        :maintainer: Evan Borgstrom <evan@borgstrom.ca>
        Severity: Minor
        Found in salt/renderers/pyobjects.py - About 4 hrs to fix

          File chocolatey.py has 330 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          # -*- coding: utf-8 -*-
          
          '''
          Manage Chocolatey package installs
          .. versionadded:: 2016.3.0
          Severity: Minor
          Found in salt/states/chocolatey.py - About 3 hrs to fix

            File win_system.py has 330 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            # -*- coding: utf-8 -*-
            '''
            Management of Windows system information
            ========================================
            
            
            Severity: Minor
            Found in salt/states/win_system.py - About 3 hrs to fix

              File pydsl.py has 330 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              # -*- coding: utf-8 -*-
              '''
              :maintainer: Jack Kuan <kjkuan@gmail.com>
              :maturity: new
              :platform: all
              Severity: Minor
              Found in salt/utils/pydsl.py - About 3 hrs to fix

                Function _purge_events has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
                Open

                def _purge_events():
                    write_profile = __opts__.get('etcd.returner_write_profile')
                    client, path, _ = _get_conn(__opts__, write_profile)
                
                    # Figure out the path that our event cache should exist at
                Severity: Minor
                Found in salt/returners/etcd_return.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 present has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
                Open

                def present(name, cloud_provider, onlyif=None, unless=None, opts=None, **kwargs):
                    '''
                    Spin up a single instance on a cloud provider, using salt-cloud. This state
                    does not take a profile argument; rather, it takes the arguments that would
                    normally be configured as part of the state.
                Severity: Minor
                Found in salt/states/cloud.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_absent has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
                Open

                def list_absent(name, value, delimiter=DEFAULT_TARGET_DELIM):
                    '''
                    Delete a value from a grain formed as a list.
                
                    .. versionadded:: 2014.1.0
                Severity: Minor
                Found in salt/states/grains.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 connection_factory_present has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
                Open

                def connection_factory_present(name,
                                               restype='connection_factory',
                                               description='',
                                               enabled=True,
                                               min_size=1,
                Severity: Minor
                Found in salt/states/glassfish.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 script has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
                Open

                def script(name,
                           source=None,
                           template=None,
                           onlyif=None,
                           unless=None,
                Severity: Minor
                Found in salt/states/cmd.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 present has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
                Open

                def present(name,
                            directory,
                            options=None,
                            owner=None,
                            user=None,
                Severity: Minor
                Found in salt/states/postgres_tablespace.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 fstab_present has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
                Open

                def fstab_present(name, fs_file, fs_vfstype, fs_mntops='defaults',
                                  fs_freq=0, fs_passno=0, mount_by=None,
                                  config='/etc/fstab', mount=True, match_on='auto',
                                  not_change=False):
                    '''Makes sure that a fstab mount point is pressent.
                Severity: Minor
                Found in salt/states/mount.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 admin_password_present has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
                Open

                def admin_password_present(name, password=None, **kwargs):
                    '''
                    Initial change of Zabbix Admin password to password taken from one of the sources (only the most prioritized one):
                        1. 'password' parameter
                        2. '_connection_password' parameter
                Severity: Minor
                Found in salt/states/zabbix_user.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 _call_function has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
                Open

                def _call_function(name, returner=None, **kwargs):
                    '''
                    Calls a function from the specified module.
                
                    :param name:
                Severity: Minor
                Found in salt/states/module.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 check_minion_cache has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
                Open

                    def check_minion_cache(self, preserve_minions=None):
                        '''
                        Check the minion cache to make sure that old minion data is cleared
                
                        Optionally, pass in a list of minions which should have their caches
                Severity: Minor
                Found in salt/key.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 delete_key has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
                Open

                    def delete_key(self,
                                    match=None,
                                    match_dict=None,
                                    preserve_minions=None,
                                    revoke_auth=False):
                Severity: Minor
                Found in salt/key.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 traverse_dict_and_list has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
                Open

                def traverse_dict_and_list(data, key, default=None, delimiter=DEFAULT_TARGET_DELIM):
                    '''
                    Traverse a dict or list using a colon-delimited (or otherwise delimited,
                    using the 'delimiter' param) target string. The target 'foo:bar:0' will
                    return data['foo']['bar'][0] if this value exists, and will otherwise
                Severity: Minor
                Found in salt/utils/data.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 expand_variables has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
                Open

                def expand_variables(a, b, expanded, path=None):
                    if path is None:
                        b = a.copy()
                        path = []
                
                
                Severity: Minor
                Found in salt/utils/saltclass.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