saltstack/salt

View on GitHub

Showing 9,398 of 17,588 total issues

File file.py has 6644 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 jquery-1.9.1.js has 6570 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    /*!
     * jQuery JavaScript Library v1.9.1
     * http://jquery.com/
     *
     * Includes Sizzle.js
    Severity: Major
    Found in doc/_themes/saltstack/static/js/vendor/jquery-1.9.1.js - About 2 wks to fix

      File dockermod.py has 5284 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 5199 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 670 (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 4187 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 virt.py has 4126 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

              File ec2.py has 4114 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

                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 state.py has 3807 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

                  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 vmware.py has 3542 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 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 485 (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

                        Function set_ has a Cognitive Complexity of 484 (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 cmdmod.py has 3440 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 433 (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

                            File postgres.py has 3033 lines of code (exceeds 250 allowed). Consider refactoring.
                            Open

                            # -*- coding: utf-8 -*-
                            '''
                            Module to provide Postgres compatibility to salt.
                            
                            :configuration: In order to connect to Postgres, certain configuration is
                            Severity: Major
                            Found in salt/modules/postgres.py - About 1 wk to fix
                              Severity
                              Category
                              Status
                              Source
                              Language