saltstack/salt

View on GitHub

Showing 9,400 of 17,590 total issues

File grafana_dashboard.py has 452 lines of code (exceeds 250 allowed). Consider refactoring.
Open

# -*- coding: utf-8 -*-
'''
Manage Grafana v2.0 Dashboards

.. versionadded:: 2016.3.0
Severity: Minor
Found in salt/states/grafana_dashboard.py - About 6 hrs to fix

    File upstart_service.py has 452 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    # -*- coding: utf-8 -*-
    '''
    Module for the management of upstart systems. The Upstart system only supports
    service starting, stopping and restarting.
    
    
    Severity: Minor
    Found in salt/modules/upstart_service.py - About 6 hrs to fix

      File linux_acl.py has 450 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      # -*- coding: utf-8 -*-
      '''
      Linux File Access Control Lists
      
      The Linux ACL state module requires the `getfacl` and `setfacl` binaries.
      Severity: Minor
      Found in salt/states/linux_acl.py - About 6 hrs to fix

        File daemons.py has 450 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        # coding: utf-8 -*-
        '''
        Make me some salt!
        '''
        
        
        Severity: Minor
        Found in salt/cli/daemons.py - About 6 hrs to fix

          File ilo.py has 449 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          # -*- coding: utf-8 -*-
          '''
          Manage HP ILO
          
          :depends: hponcfg (SmartStart Scripting Toolkit Linux Edition)
          Severity: Minor
          Found in salt/modules/ilo.py - About 6 hrs to fix

            File vboxmanage.py has 448 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            # -*- coding: utf-8 -*-
            '''
            Support for VirtualBox using the VBoxManage command
            
            .. versionadded:: 2016.3.0
            Severity: Minor
            Found in salt/modules/vboxmanage.py - About 6 hrs to fix

              File mac_user.py has 448 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              # -*- coding: utf-8 -*-
              '''
              Manage users on Mac OS 10.7+
              
              .. important::
              Severity: Minor
              Found in salt/modules/mac_user.py - About 6 hrs to fix

                Function _install_requirements has a Cognitive Complexity of 44 (exceeds 5 allowed). Consider refactoring.
                Open

                def _install_requirements(session, transport, *extra_requirements):
                    # Install requirements
                    distro_requirements = None
                
                    if transport == 'tcp':
                Severity: Minor
                Found in noxfile.py - About 6 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_ldap_entries has a Cognitive Complexity of 44 (exceeds 5 allowed). Consider refactoring.
                Open

                def __expand_ldap_entries(entries, opts=None):
                    '''
                
                    :param entries: ldap subtree in external_auth config option
                    :param opts: Opts to use when __opts__ not defined
                Severity: Minor
                Found in salt/auth/ldap.py - About 6 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 hosted_zone_present has a Cognitive Complexity of 44 (exceeds 5 allowed). Consider refactoring.
                Open

                def hosted_zone_present(name, domain_name=None, private_zone=False, caller_ref=None, comment='',
                                        vpc_id=None, vpc_name=None, vpc_region=None, region=None, key=None,
                                        keyid=None, profile=None):
                    '''
                    Ensure a hosted zone exists with the given attributes. Note that most
                Severity: Minor
                Found in salt/states/boto_route53.py - About 6 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 parallel_runners has a Cognitive Complexity of 44 (exceeds 5 allowed). Consider refactoring.
                Open

                def parallel_runners(name, runners, **kwargs):  # pylint: disable=unused-argument
                    '''
                    Executes multiple runner modules on the master in parallel.
                
                    .. versionadded:: 2017.x.0 (Nitrogen)
                Severity: Minor
                Found in salt/states/saltmod.py - About 6 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 44 (exceeds 5 allowed). Consider refactoring.
                Open

                def managed(name, port, services=None, user=None, password=None, bypass_domains=None, network_service='Ethernet'):
                    '''
                    Manages proxy settings for this mininon
                
                    name
                Severity: Minor
                Found in salt/states/proxy.py - About 6 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 argspec_report has a Cognitive Complexity of 44 (exceeds 5 allowed). Consider refactoring.
                Open

                def argspec_report(functions, module=''):
                    '''
                    Pass in a functions dict as it is returned from the loader and return the
                    argspec function signatures
                    '''
                Severity: Minor
                Found in salt/utils/args.py - About 6 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 fopen has a Cognitive Complexity of 44 (exceeds 5 allowed). Consider refactoring.
                Open

                def fopen(*args, **kwargs):
                    '''
                    Wrapper around open() built-in to set CLOEXEC on the fd.
                
                    This flag specifies that the file descriptor should be closed when an exec
                Severity: Minor
                Found in salt/utils/files.py - About 6 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_onfail_requisites has a Cognitive Complexity of 44 (exceeds 5 allowed). Consider refactoring.
                Open

                def check_onfail_requisites(state_id, state_result, running, highstate):
                    '''
                    When a state fail and is part of a highstate, check
                    if there is onfail requisites.
                    When we find onfail requisites, we will consider the state failed
                Severity: Minor
                Found in salt/utils/state.py - About 6 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 build_schedule_item has a Cognitive Complexity of 44 (exceeds 5 allowed). Consider refactoring.
                Open

                def build_schedule_item(name, **kwargs):
                    '''
                    Build a schedule job
                
                    CLI Example:
                Severity: Minor
                Found in salt/modules/schedule.py - About 6 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 44 (exceeds 5 allowed). Consider refactoring.
                Open

                def set(key,
                        val='',
                        force=False,
                        destructive=False,
                        delimiter=DEFAULT_TARGET_DELIM):
                Severity: Minor
                Found in salt/modules/grains.py - About 6 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 get_route has a Cognitive Complexity of 44 (exceeds 5 allowed). Consider refactoring.
                Open

                def get_route(ip):
                    '''
                    Return routing information for given destination ip
                
                    .. versionadded:: 2015.5.3
                Severity: Minor
                Found in salt/modules/network.py - About 6 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 mod_repo has a Cognitive Complexity of 44 (exceeds 5 allowed). Consider refactoring.
                Open

                def mod_repo(repo, basedir=None, **kwargs):
                    '''
                    Modify one or more values for a repo. If the repo does not exist, it will
                    be created, so long as the following values are specified:
                
                
                Severity: Minor
                Found in salt/modules/yumpkg.py - About 6 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 init has a Cognitive Complexity of 44 (exceeds 5 allowed). Consider refactoring.
                Open

                def init(opts):
                    '''
                    This function gets called when the proxy starts up. For
                    ESXi devices, the host, login credentials, and, if configured,
                    the protocol and port are cached.
                Severity: Minor
                Found in salt/proxy/esxi.py - About 6 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