saltstack/salt

View on GitHub

Showing 9,400 of 17,590 total issues

Function get_printout has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
Open

def get_printout(out, opts=None, **kwargs):
    '''
    Return a printer function
    '''
    if opts is None:
Severity: Minor
Found in salt/output/__init__.py - About 3 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 defaultPrefilter has 97 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function defaultPrefilter( elem, props, opts ) {
    /*jshint validthis:true */
    var prop, index, length,
        value, dataShow, toggle,
        tween, hooks, oldfire,
Severity: Major
Found in doc/_themes/saltstack/static/js/vendor/jquery-1.9.1.js - About 3 hrs to fix

    File ciscoconfparse_mod.py has 328 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    # -*- coding: utf-8 -*-
    '''
    Execution module for `ciscoconfparse <http://www.pennington.net/py/ciscoconfparse/index.html>`_
    
    .. versionadded:: 2019.2.0
    Severity: Minor
    Found in salt/modules/ciscoconfparse_mod.py - About 3 hrs to fix

      File win_dism.py has 327 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      # -*- coding: utf-8 -*-
      '''
      Installing of Windows features using DISM
      =========================================
      
      
      Severity: Minor
      Found in salt/states/win_dism.py - About 3 hrs to fix

        File sql_base.py has 327 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        # -*- coding: utf-8 -*-
        '''
        Retrieve Pillar data by doing a SQL query
        
        This module is not meant to be used directly as an ext_pillar.
        Severity: Minor
        Found in salt/pillar/sql_base.py - About 3 hrs to fix

          LocalClient has 31 functions (exceeds 20 allowed). Consider refactoring.
          Open

          class LocalClient(object):
              '''
              The interface used by the :command:`salt` CLI tool on the Salt Master
          
              ``LocalClient`` is used to send a command to Salt minions to execute
          Severity: Minor
          Found in salt/client/__init__.py - About 3 hrs to fix

            SaltEvent has 31 functions (exceeds 20 allowed). Consider refactoring.
            Open

            class SaltEvent(object):
                '''
                Warning! Use the get_event function or the code will not be
                RAET compatible
                The base class used to manage salt events
            Severity: Minor
            Found in salt/utils/event.py - About 3 hrs to fix

              CkMinions has 31 functions (exceeds 20 allowed). Consider refactoring.
              Open

              class CkMinions(object):
                  '''
                  Used to check what minions should respond from a target
              
                  Note: This is a best-effort set of the minions that would match a target.
              Severity: Minor
              Found in salt/utils/minions.py - About 3 hrs to fix

                _BaseNetwork has 31 functions (exceeds 20 allowed). Consider refactoring.
                Open

                class _BaseNetwork(_IPAddressBase):
                
                    """A generic IP network object.
                
                    This IP class contains the version independent methods which are
                Severity: Minor
                Found in salt/ext/ipaddress.py - About 3 hrs to fix

                  File dictdiffer.py has 325 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  # -*- coding: utf-8 -*-
                  '''
                   Calculate the difference between two dictionaries as:
                      (1) items added
                      (2) items removed
                  Severity: Minor
                  Found in salt/utils/dictdiffer.py - About 3 hrs to fix

                    File key.py has 325 lines of code (exceeds 250 allowed). Consider refactoring.
                    Open

                    # -*- coding: utf-8 -*-
                    '''
                    Wheel system wrapper for the Salt key system to be used in interactions with
                    the Salt Master programmatically.
                    
                    
                    Severity: Minor
                    Found in salt/wheel/key.py - About 3 hrs to fix

                      File libcloud_loadbalancer.py has 324 lines of code (exceeds 250 allowed). Consider refactoring.
                      Open

                      # -*- coding: utf-8 -*-
                      '''
                      Apache Libcloud Load Balancer Management
                      ========================================
                      
                      
                      Severity: Minor
                      Found in salt/modules/libcloud_loadbalancer.py - About 3 hrs to fix

                        File proxy.py has 324 lines of code (exceeds 250 allowed). Consider refactoring.
                        Open

                        # -*- coding: utf-8 -*-
                        '''
                        This module allows you to manage proxy settings
                        
                        .. code-block:: bash
                        Severity: Minor
                        Found in salt/modules/proxy.py - About 3 hrs to fix

                          File supervisord.py has 324 lines of code (exceeds 250 allowed). Consider refactoring.
                          Open

                          # -*- coding: utf-8 -*-
                          '''
                          Provide the service module for system supervisord or supervisord in a
                          virtualenv
                          '''
                          Severity: Minor
                          Found in salt/modules/supervisord.py - About 3 hrs to fix

                            File win_groupadd.py has 324 lines of code (exceeds 250 allowed). Consider refactoring.
                            Open

                            # -*- coding: utf-8 -*-
                            '''
                            Manage groups on Windows
                            
                            .. important::
                            Severity: Minor
                            Found in salt/modules/win_groupadd.py - About 3 hrs to fix

                              File trafficserver.py has 323 lines of code (exceeds 250 allowed). Consider refactoring.
                              Open

                              # -*- coding: utf-8 -*-
                              '''
                              Apache Traffic Server execution module.
                              
                              .. versionadded:: 2015.8.0
                              Severity: Minor
                              Found in salt/modules/trafficserver.py - About 3 hrs to fix

                                File rvm.py has 323 lines of code (exceeds 250 allowed). Consider refactoring.
                                Open

                                # -*- coding: utf-8 -*-
                                '''
                                Manage ruby installations and gemsets with RVM, the Ruby Version Manager.
                                '''
                                from __future__ import absolute_import, unicode_literals, print_function
                                Severity: Minor
                                Found in salt/modules/rvm.py - About 3 hrs to fix

                                  Function _bind has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
                                  Open

                                  def _bind(username, password, anonymous=False, opts=None):
                                      '''
                                      Authenticate via an LDAP bind
                                      '''
                                      # Get config params; create connection dictionary
                                  Severity: Minor
                                  Found in salt/auth/ldap.py - About 3 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_autosign_grains has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
                                  Open

                                      def check_autosign_grains(self, autosign_grains):
                                          '''
                                          Check for matching grains in the autosign_grains_dir.
                                          '''
                                          if not autosign_grains or 'autosign_grains_dir' not in self.opts:
                                  Severity: Minor
                                  Found in salt/daemons/masterapi.py - About 3 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_present has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
                                  Open

                                  def property_present(name, property, value):
                                      '''
                                      Ensure property has a certain value
                                  
                                      name : string
                                  Severity: Minor
                                  Found in salt/states/zone.py - About 3 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