saltstack/salt

View on GitHub

Showing 23,424 of 23,488 total issues

File vsphere.py has 7716 lines of code (exceeds 250 allowed). Consider refactoring.
Open

# -*- coding: utf-8 -*-
'''
Manage VMware vCenter servers and ESXi hosts.

.. versionadded:: 2015.8.4
Severity: Major
Found in salt/modules/vsphere.py - About 3 wks to fix

    File win_lgpo.py has 7583 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    # -*- coding: utf-8 -*-
    '''
    Manage Local Policy on Windows
    
    This module allows configuring local group policy (i.e. ``gpedit.msc``) on a
    Severity: Major
    Found in salt/modules/win_lgpo.py - About 3 wks to fix

      File file.py has 6608 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      # -*- coding: utf-8 -*-
      '''
      Operations on regular files, special files, directories, and symlinks
      =====================================================================
      
      
      Severity: Major
      Found in salt/states/file.py - About 2 wks to fix

        File dockermod.py has 5265 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        # -*- coding: utf-8 -*-
        '''
        Management of Docker Containers
        
        .. versionadded:: 2015.8.0
        Severity: Major
        Found in salt/modules/dockermod.py - About 2 wks to fix

          File file.py has 5120 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          # -*- coding: utf-8 -*-
          '''
          Manage information about regular files, directories,
          and special files on the minion, set/read user,
          group, mode, and data
          Severity: Major
          Found in salt/modules/file.py - About 2 wks to fix

            Function latest has a Cognitive Complexity of 669 (exceeds 5 allowed). Consider refactoring.
            Open

            def latest(name,
                       rev='HEAD',
                       target=None,
                       branch=None,
                       user=None,
            Severity: Minor
            Found in salt/states/git.py - About 1 wk 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 git.py has 4159 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            # -*- coding: utf-8 -*-
            '''
            Support for the Git SCM
            '''
            from __future__ import absolute_import, print_function, unicode_literals
            Severity: Major
            Found in salt/modules/git.py - About 1 wk to fix

              File ec2.py has 4122 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              # -*- coding: utf-8 -*-
              '''
              The EC2 Cloud Module
              ====================
              
              
              Severity: Major
              Found in salt/cloud/clouds/ec2.py - About 1 wk to fix

                File virt.py has 3961 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                # -*- coding: utf-8 -*-
                '''
                Work with virtual machines managed by libvirt
                
                :depends: libvirt Python module
                Severity: Major
                Found in salt/modules/virt.py - About 1 wk to fix

                  Function requisite_in has a Cognitive Complexity of 534 (exceeds 5 allowed). Consider refactoring.
                  Open

                      def requisite_in(self, high):
                          '''
                          Extend the data reference with requisite_in arguments
                          '''
                          req_in = {'require_in', 'watch_in', 'onfail_in', 'onchanges_in', 'use', 'use_in', 'prereq', 'prereq_in'}
                  Severity: Minor
                  Found in salt/state.py - About 1 wk 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 lxc.py has 3760 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  # -*- coding: utf-8 -*-
                  '''
                  Control Linux Containers via Salt
                  
                  :depends: lxc package for distribution
                  Severity: Major
                  Found in salt/modules/lxc.py - About 1 wk to fix

                    Function _checkAllAdmxPolicies has a Cognitive Complexity of 519 (exceeds 5 allowed). Consider refactoring.
                    Open

                    def _checkAllAdmxPolicies(policy_class,
                                              adml_language='en-US',
                                              return_full_policy_names=False,
                                              hierarchical_return=False,
                                              return_not_configured=False):
                    Severity: Minor
                    Found in salt/modules/win_lgpo.py - About 1 wk 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 state.py has 3712 lines of code (exceeds 250 allowed). Consider refactoring.
                    Open

                    # -*- coding: utf-8 -*-
                    '''
                    The State Compiler is used to execute states in Salt. A state is unlike
                    an execution module in that instead of just executing a command, it
                    ensures that a certain state is present on the system.
                    Severity: Major
                    Found in salt/state.py - About 1 wk to fix

                      Function set_ has a Cognitive Complexity of 495 (exceeds 5 allowed). Consider refactoring.
                      Open

                      def set_(computer_policy=None,
                               user_policy=None,
                               cumulative_rights_assignments=True,
                               adml_language='en-US'):
                          '''
                      Severity: Minor
                      Found in salt/modules/win_lgpo.py - About 1 wk 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 opennebula.py has 3516 lines of code (exceeds 250 allowed). Consider refactoring.
                      Open

                      # -*- coding: utf-8 -*-
                      '''
                      OpenNebula Cloud Module
                      =======================
                      
                      
                      Severity: Major
                      Found in salt/cloud/clouds/opennebula.py - About 1 wk to fix

                        Function extracted has a Cognitive Complexity of 484 (exceeds 5 allowed). Consider refactoring.
                        Open

                        def extracted(name,
                                      source,
                                      source_hash=None,
                                      source_hash_name=None,
                                      source_hash_update=False,
                        Severity: Minor
                        Found in salt/states/archive.py - About 1 wk 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 vmware.py has 3497 lines of code (exceeds 250 allowed). Consider refactoring.
                        Open

                        # -*- coding: utf-8 -*-
                        # pylint: disable=C0302
                        '''
                        VMware Cloud Module
                        ===================
                        Severity: Major
                        Found in salt/cloud/clouds/vmware.py - About 1 wk to fix

                          File cmdmod.py has 3419 lines of code (exceeds 250 allowed). Consider refactoring.
                          Open

                          # -*- coding: utf-8 -*-
                          '''
                          A module for shelling out.
                          
                          Keep in mind that this module is insecure, in that it can give whomever has
                          Severity: Major
                          Found in salt/modules/cmdmod.py - About 1 wk to fix

                            Function eval has a Cognitive Complexity of 431 (exceeds 5 allowed). Consider refactoring.
                            Open

                                def eval(self, now=None):
                                    '''
                                    Evaluate and execute the schedule
                            
                                    :param datetime now: Override current time with a datetime object instance``
                            Severity: Minor
                            Found in salt/utils/schedule.py - About 1 wk 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 vmware.py has 3073 lines of code (exceeds 250 allowed). Consider refactoring.
                            Open

                            # -*- coding: utf-8 -*-
                            '''
                            Connection library for VMware
                            
                            .. versionadded:: 2015.8.2
                            Severity: Major
                            Found in salt/utils/vmware.py - About 1 wk to fix
                              Severity
                              Category
                              Status
                              Source
                              Language