saltstack/salt

View on GitHub

Showing 9,400 of 17,590 total issues

File iosconfig.py has 352 lines of code (exceeds 250 allowed). Consider refactoring.
Open

# -*- coding: utf-8 -*-
'''
Cisco IOS configuration manipulation helpers

.. versionadded:: 2019.2.0
Severity: Minor
Found in salt/modules/iosconfig.py - About 4 hrs to fix

    File couchdb_return.py has 351 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    # -*- coding: utf-8 -*-
    '''
    Simple returner for CouchDB. Optional configuration
    settings are listed below, along with sane defaults:
    
    
    Severity: Minor
    Found in salt/returners/couchdb_return.py - About 4 hrs to fix

      File fileserver.py has 351 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      # -*- coding: utf-8 -*-
      '''
      Directly manage the Salt fileserver plugins
      '''
      from __future__ import absolute_import, print_function, unicode_literals
      Severity: Minor
      Found in salt/runners/fileserver.py - About 4 hrs to fix

        Function _pre_flight has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring.
        Open

            def _pre_flight(self):
                '''
                Run pre flight checks. If anything in this method fails then the master
                should not start up.
                '''
        Severity: Minor
        Found in salt/master.py - About 4 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 targets_registered has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring.
        Open

        def targets_registered(name, targets, region=None, key=None, keyid=None,
                               profile=None, **kwargs):
            '''
            .. versionadded:: 2017.7.0
        
        
        Severity: Minor
        Found in salt/states/boto_elbv2.py - About 4 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 30 (exceeds 5 allowed). Consider refactoring.
        Open

        def present(name,
                    tablespace=None,
                    encoding=None,
                    lc_collate=None,
                    lc_ctype=None,
        Severity: Minor
        Found in salt/states/postgres_database.py - About 4 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 _acl_to_grant has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring.
        Open

        def _acl_to_grant(ACL, owner_canonical_id):
            if 'AccessControlPolicy' in ACL:
                ret = copy.deepcopy(ACL['AccessControlPolicy'])
                ret['Owner'] = _normalize_user(ret['Owner'])
                for item in ACL.get('Grants', ()):
        Severity: Minor
        Found in salt/states/boto_s3_bucket.py - About 4 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 targets_deregistered has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring.
        Open

        def targets_deregistered(name, targets, region=None, key=None, keyid=None,
                                 profile=None, **kwargs):
            '''
            Remove targets to an Application Load Balancer target group.
        
        
        Severity: Minor
        Found in salt/states/boto_elbv2.py - About 4 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 property_absent has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring.
        Open

        def property_absent(name, property):
            '''
            Ensure property is absent
        
            name : string
        Severity: Minor
        Found in salt/states/zone.py - About 4 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 30 (exceeds 5 allowed). Consider refactoring.
        Open

        def present(name,
                    **kwargs):
            '''
            Ensure a job is present in the schedule
        
        
        Severity: Minor
        Found in salt/states/schedule.py - About 4 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 _process_entries has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring.
        Open

        def _process_entries(l, entries):
            '''Helper for managed() to process entries and return before/after views
        
            Collect the current database state and update it according to the
            data in :py:func:`managed`'s ``entries`` parameter.  Return the
        Severity: Minor
        Found in salt/states/ldap.py - About 4 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 tidied has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring.
        Open

        def tidied(name,
                   age=0,
                   matches=None,
                   rmdirs=False,
                   size=0,
        Severity: Minor
        Found in salt/states/file.py - About 4 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 blockreplace has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring.
        Open

        def blockreplace(
                name,
                marker_start='#-- start managed zone --',
                marker_end='#-- end managed zone --',
                source=None,
        Severity: Minor
        Found in salt/states/file.py - About 4 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 mapped has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring.
        Open

        def mapped(name,
                   device,
                   keyfile=None,
                   opts=None,
                   config='/etc/crypttab',
        Severity: Minor
        Found in salt/states/cryptdev.py - About 4 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 user_present has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring.
        Open

        def user_present(name, password=None, roles=None, encrypted=False, crypt_salt=None, algorithm='sha256'):
            '''
            Ensure a user is present with the specified groups
        
            name
        Severity: Minor
        Found in salt/states/onyx.py - About 4 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 user_present has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring.
        Open

        def user_present(name, password=None, roles=None, encrypted=False, crypt_salt=None, algorithm='sha256'):
            '''
            Ensure a user is present with the specified groups
        
            name
        Severity: Minor
        Found in salt/states/nxos.py - About 4 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 tuned has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring.
        Open

        def tuned(name, **kwargs):
            '''
            Manage options of block device
        
            name
        Severity: Minor
        Found in salt/states/blockdev.py - About 4 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 _enable has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring.
        Open

        def _enable(name, started, result=True, skip_verify=False, **kwargs):
            '''
            Enable the service
            '''
            ret = {}
        Severity: Minor
        Found in salt/states/service.py - About 4 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 flags has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring.
        Open

        def flags(name,
                  use=None,
                  accept_keywords=None,
                  env=None,
                  license=None,
        Severity: Minor
        Found in salt/states/portage_config.py - About 4 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 vsan_configured has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring.
        Open

        def vsan_configured(name, enabled, add_disks_to_vsan=False):
            '''
            Configures a host's VSAN properties such as enabling or disabling VSAN, or
            adding VSAN-eligible disks to the VSAN system for the host.
        
        
        Severity: Minor
        Found in salt/states/esxi.py - About 4 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