saltstack/salt

View on GitHub

Showing 9,400 of 17,590 total issues

File bgp.py has 308 lines of code (exceeds 250 allowed). Consider refactoring.
Open

# -*- coding: utf-8 -*-
'''
BGP Finder
==========

Severity: Minor
Found in salt/runners/bgp.py - About 3 hrs to fix

    File path.py has 307 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    # -*- coding: utf-8 -*-
    '''
    Platform independent versions of some os/os.path functions. Gets around PY2's
    lack of support for reading NTFS links.
    '''
    Severity: Minor
    Found in salt/utils/path.py - About 3 hrs to fix

      Function Animation has 84 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      function Animation( elem, properties, options ) {
          var result,
              stopped,
              index = 0,
              length = animationPrefilters.length,
      Severity: Major
      Found in doc/_themes/saltstack/static/js/vendor/jquery-1.9.1.js - About 3 hrs to fix

        File zpool.py has 306 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        # -*- coding: utf-8 -*-
        '''
        States for managing zpools
        
        :maintainer:    Jorge Schrauwen <sjorge@blackdot.be>
        Severity: Minor
        Found in salt/states/zpool.py - About 3 hrs to fix

          File probes.py has 306 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          # -*- coding: utf-8 -*-
          '''
          Network Probes
          ===============
          
          
          Severity: Minor
          Found in salt/states/probes.py - About 3 hrs to fix

            File junos_syslog.py has 306 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            # -*- coding: utf-8 -*-
            '''
            Junos Syslog Engine
            ==========================
            
            
            Severity: Minor
            Found in salt/engines/junos_syslog.py - About 3 hrs to fix

              File clc.py has 306 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              # -*- coding: utf-8 -*-
              '''
              CenturyLink Cloud Module
              ========================
              
              
              Severity: Minor
              Found in salt/cloud/clouds/clc.py - About 3 hrs to fix

                Terminal has 28 functions (exceeds 20 allowed). Consider refactoring.
                Open

                class Terminal(object):
                    '''
                    I'm a virtual terminal
                    '''
                    def __init__(self,
                Severity: Minor
                Found in salt/utils/vt.py - About 3 hrs to fix

                  BaseHighState has 28 functions (exceeds 20 allowed). Consider refactoring.
                  Open

                  class BaseHighState(object):
                      '''
                      The BaseHighState is an abstract base class that is the foundation of
                      running a highstate, extend it and add a self.state object of type State.
                  
                  
                  Severity: Minor
                  Found in salt/state.py - About 3 hrs to fix

                    File boto_cloudtrail.py has 305 lines of code (exceeds 250 allowed). Consider refactoring.
                    Open

                    # -*- coding: utf-8 -*-
                    '''
                    Manage CloudTrail Objects
                    =========================
                    
                    
                    Severity: Minor
                    Found in salt/states/boto_cloudtrail.py - About 3 hrs to fix

                      Function cloud_init_interface has 83 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      def cloud_init_interface(name, vm_=None, **kwargs):
                          '''
                          Interface between salt.cloud.lxc driver and lxc.init
                          ``vm_`` is a mapping of vm opts in the salt.cloud format
                          as documented for the lxc driver.
                      Severity: Major
                      Found in salt/modules/lxc.py - About 3 hrs to fix

                        File etcd_util.py has 304 lines of code (exceeds 250 allowed). Consider refactoring.
                        Open

                        # -*- coding: utf-8 -*-
                        '''
                        Utilities for working with etcd
                        
                        .. versionadded:: 2014.7.0
                        Severity: Minor
                        Found in salt/utils/etcd_util.py - About 3 hrs to fix

                          File nacl.py has 304 lines of code (exceeds 250 allowed). Consider refactoring.
                          Open

                          # -*- coding: utf-8 -*-
                          '''
                          Common code shared between the nacl module and runner.
                          '''
                          
                          
                          Severity: Minor
                          Found in salt/utils/nacl.py - About 3 hrs to fix

                            File mac_portspkg.py has 304 lines of code (exceeds 250 allowed). Consider refactoring.
                            Open

                            # -*- coding: utf-8 -*-
                            '''
                            Support for MacPorts under macOS.
                            
                            This module has some caveats.
                            Severity: Minor
                            Found in salt/modules/mac_portspkg.py - About 3 hrs to fix

                              File rbenv.py has 304 lines of code (exceeds 250 allowed). Consider refactoring.
                              Open

                              # -*- coding: utf-8 -*-
                              '''
                              Manage ruby installations with rbenv. rbenv is supported on Linux and macOS.
                              rbenv doesn't work on Windows (and isn't really necessary on Windows as there is
                              no system Ruby on Windows). On Windows, the RubyInstaller and/or Pik are both
                              Severity: Minor
                              Found in salt/modules/rbenv.py - About 3 hrs to fix

                                Function send has 82 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                                send: function( headers, complete ) {
                                
                                                    // Get a new xhr
                                                    var handle, i,
                                                        xhr = s.xhr();
                                Severity: Major
                                Found in doc/_themes/saltstack/static/js/vendor/jquery-1.9.1.js - About 3 hrs to fix

                                  File puppet.py has 303 lines of code (exceeds 250 allowed). Consider refactoring.
                                  Open

                                  # -*- coding: utf-8 -*-
                                  '''
                                  Execute puppet routines
                                  '''
                                  
                                  
                                  Severity: Minor
                                  Found in salt/modules/puppet.py - About 3 hrs to fix

                                    File dnsutil.py has 303 lines of code (exceeds 250 allowed). Consider refactoring.
                                    Open

                                    # -*- coding: utf-8 -*-
                                    '''
                                    Compendium of generic DNS utilities.
                                    
                                    .. note::
                                    Severity: Minor
                                    Found in salt/modules/dnsutil.py - About 3 hrs to fix

                                      File win_snmp.py has 303 lines of code (exceeds 250 allowed). Consider refactoring.
                                      Open

                                      # -*- coding: utf-8 -*-
                                      '''
                                      Module for managing SNMP service settings on Windows servers.
                                      The Windows feature 'SNMP-Service' must be installed.
                                      '''
                                      Severity: Minor
                                      Found in salt/modules/win_snmp.py - About 3 hrs to fix

                                        Function publish_payload has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
                                        Open

                                            def publish_payload(self, package, _):
                                                log.debug('TCP PubServer sending payload: %s', package)
                                                payload = salt.transport.frame.frame_msg(package['payload'])
                                        
                                                to_remove = []
                                        Severity: Minor
                                        Found in salt/transport/tcp.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