saltstack/salt

View on GitHub

Showing 9,400 of 17,590 total issues

File random_org.py has 612 lines of code (exceeds 250 allowed). Consider refactoring.
Open

# -*- coding: utf-8 -*-
'''
Module for retrieving random information from Random.org

.. versionadded:: 2015.5.0
Severity: Major
Found in salt/modules/random_org.py - About 1 day to fix

    File firewalld.py has 610 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    # -*- coding: utf-8 -*-
    '''
    Management of firewalld
    
    .. versionadded:: 2015.8.0
    Severity: Major
    Found in salt/states/firewalld.py - About 1 day to fix

      File keystoneng.py has 610 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      # -*- coding: utf-8 -*-
      '''
      Keystone module for interacting with OpenStack Keystone
      
      .. versionadded:: 2018.3.0
      Severity: Major
      Found in salt/modules/keystoneng.py - About 1 day to fix

        File libcloud_compute.py has 608 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        # -*- coding: utf-8 -*-
        '''
        Apache Libcloud Compute Management
        ==================================
        
        
        Severity: Major
        Found in salt/modules/libcloud_compute.py - About 1 day to fix

          Function present has a Cognitive Complexity of 67 (exceeds 5 allowed). Consider refactoring.
          Open

          def present(name, listeners, availability_zones=None, subnets=None,
                      subnet_names=None, security_groups=None, scheme='internet-facing',
                      health_check=None, attributes=None,
                      attributes_from_pillar="boto_elb_attributes", cnames=None,
                      alarms=None, alarms_from_pillar="boto_elb_alarms", policies=None,
          Severity: Minor
          Found in salt/states/boto_elb.py - About 1 day 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 67 (exceeds 5 allowed). Consider refactoring.
          Open

          def running(name,
                      restart=False,
                      update=False,
                      user=None,
                      conf_file=None,
          Severity: Minor
          Found in salt/states/supervisord.py - About 1 day 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 dvs_configured has a Cognitive Complexity of 67 (exceeds 5 allowed). Consider refactoring.
          Open

          def dvs_configured(name, dvs):
              '''
              Configures a DVS.
          
              Creates a new DVS, if it doesn't exist in the provided datacenter or
          Severity: Minor
          Found in salt/states/dvs.py - About 1 day 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 enforce_dependencies has a Cognitive Complexity of 67 (exceeds 5 allowed). Consider refactoring.
          Open

              def enforce_dependencies(cls, functions, kind):
                  '''
                  This is a class global method to enforce the dependencies that you
                  currently know about.
                  It will modify the "functions" dict and remove/replace modules that
          Severity: Minor
          Found in salt/utils/decorators/__init__.py - About 1 day 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 compare_params has a Cognitive Complexity of 67 (exceeds 5 allowed). Consider refactoring.
          Open

          def compare_params(defined, existing, return_old_value=False):
              '''
              .. versionadded:: 2017.7
          
              Compares Zabbix object definition against existing Zabbix object.
          Severity: Minor
          Found in salt/modules/zabbix.py - About 1 day 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 rm_ace has a Cognitive Complexity of 67 (exceeds 5 allowed). Consider refactoring.
          Open

          def rm_ace(path, objectType, user, permission=None, acetype=None, propagation=None):
              r'''
              remove an ace to an object
          
              path:  path to the object (i.e. c:\\temp\\file, HKEY_LOCAL_MACHINE\\SOFTWARE\\KEY, etc)
          Severity: Minor
          Found in salt/modules/win_dacl.py - About 1 day 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 _salt has a Cognitive Complexity of 67 (exceeds 5 allowed). Consider refactoring.
          Open

          def _salt(fun, *args, **kw):
              '''Execute a salt function on a specific minion
          
              Special kwargs:
          
          
          Severity: Minor
          Found in salt/cloud/clouds/lxc.py - About 1 day 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 validate has a Cognitive Complexity of 67 (exceeds 5 allowed). Consider refactoring.
          Open

          def validate(config):
              '''
              Validate the beacon configuration
              '''
          
          
          Severity: Minor
          Found in salt/beacons/inotify.py - About 1 day 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

          File etcd_return.py has 607 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          # -*- coding: utf-8 -*-
          '''
          Return data to an etcd server or cluster
          
          :depends: - python-etcd
          Severity: Major
          Found in salt/returners/etcd_return.py - About 1 day to fix

            File boto_rds.py has 607 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            # -*- coding: utf-8 -*-
            '''
            Manage RDSs
            ===========
            
            
            Severity: Major
            Found in salt/states/boto_rds.py - About 1 day to fix

              File dellchassis.py has 605 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              # -*- coding: utf-8 -*-
              '''
              Manage chassis via Salt Proxies.
              
              .. versionadded:: 2015.8.2
              Severity: Major
              Found in salt/states/dellchassis.py - About 1 day to fix

                File nxos.py has 604 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                # -*- coding: utf-8 -*-
                '''
                Execution module for Cisco NX OS Switches.
                
                .. versionadded:: 2016.11.0
                Severity: Major
                Found in salt/modules/nxos.py - About 1 day to fix

                  File grains.py has 601 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  # -*- coding: utf-8 -*-
                  '''
                  Return/control aspects of the grains data
                  
                  Grains set or altered with this module are stored in the 'grains'
                  Severity: Major
                  Found in salt/modules/grains.py - About 1 day to fix

                    Function present has a Cognitive Complexity of 66 (exceeds 5 allowed). Consider refactoring.
                    Open

                    def present(name,
                                gid=None,
                                system=False,
                                addusers=None,
                                delusers=None,
                    Severity: Minor
                    Found in salt/states/group.py - About 1 day 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 diskgroups_configured has a Cognitive Complexity of 66 (exceeds 5 allowed). Consider refactoring.
                    Open

                    def diskgroups_configured(name, diskgroups, erase_disks=False):
                        '''
                        Configures the disk groups to use for vsan.
                    
                        This function will do the following:
                    Severity: Minor
                    Found in salt/states/esxi.py - About 1 day 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 ssh_configured has a Cognitive Complexity of 66 (exceeds 5 allowed). Consider refactoring.
                    Open

                    def ssh_configured(name,
                                       service_running,
                                       ssh_key=None,
                                       ssh_key_file=None,
                                       service_policy=None,
                    Severity: Minor
                    Found in salt/states/esxi.py - About 1 day 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