saltstack/salt

View on GitHub

Showing 9,400 of 17,590 total issues

File virtualenv_mod.py has 273 lines of code (exceeds 250 allowed). Consider refactoring.
Open

# -*- coding: utf-8 -*-
'''
Setup of Python virtualenv sandboxes.

.. versionadded:: 0.17.0
Severity: Minor
Found in salt/states/virtualenv_mod.py - About 2 hrs to fix

    File minionfs.py has 273 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    # -*- coding: utf-8 -*-
    '''
    Fileserver backend which serves files pushed to the Master
    
    The :mod:`cp.push <salt.modules.cp.push>` function allows Minions to push files
    Severity: Minor
    Found in salt/fileserver/minionfs.py - About 2 hrs to fix

      File mongo_future_return.py has 272 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      # -*- coding: utf-8 -*-
      '''
      Return data to a mongodb server
      
      Required python modules: pymongo
      Severity: Minor
      Found in salt/returners/mongo_future_return.py - About 2 hrs to fix

        Function superMatcher has 63 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                superMatcher = function( seed, context, xml, results, expandContext ) {
                    var elem, j, matcher,
                        setMatched = [],
                        matchedCount = 0,
                        i = "0",
        Severity: Major
        Found in doc/_themes/saltstack/static/js/vendor/jquery-1.9.1.js - About 2 hrs to fix

          File f5.py has 271 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          # -*- coding: utf-8 -*-
          '''
          Runner to provide F5 Load Balancer functionality
          
          :depends:   - pycontrol Python module
          Severity: Minor
          Found in salt/runners/f5.py - About 2 hrs to fix

            _policy_info has 23 functions (exceeds 20 allowed). Consider refactoring.
            Open

            class _policy_info(object):
                r'''
                Policy Helper Class
                ===================
            
            
            Severity: Minor
            Found in salt/modules/win_lgpo.py - About 2 hrs to fix

              Cloud has 23 functions (exceeds 20 allowed). Consider refactoring.
              Open

              class Cloud(object):
                  '''
                  An object for the creation of new VMs
                  '''
                  def __init__(self, opts):
              Severity: Minor
              Found in salt/cloud/__init__.py - About 2 hrs to fix

                File api.py has 270 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                # -*- coding: utf-8 -*-
                '''
                This module provides the point of entry for client applications to interface to
                salt. The purpose is to have a simplified consistent interface for various
                client applications.
                Severity: Minor
                Found in salt/client/api.py - About 2 hrs to fix

                  File at.py has 270 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  # -*- coding: utf-8 -*-
                  '''
                  Wrapper module for at(1)
                  
                  Also, a 'tag' feature has been added to more
                  Severity: Minor
                  Found in salt/modules/at.py - About 2 hrs to fix

                    File zk_concurrency.py has 270 lines of code (exceeds 250 allowed). Consider refactoring.
                    Open

                    # -*- coding: utf-8 -*-
                    '''
                    Concurrency controls in zookeeper
                    =========================================================================
                    
                    
                    Severity: Minor
                    Found in salt/modules/zk_concurrency.py - About 2 hrs to fix

                      File inotify.py has 270 lines of code (exceeds 250 allowed). Consider refactoring.
                      Open

                      # -*- coding: utf-8 -*-
                      '''
                      Watch files and translate the changes into salt events
                      
                      :depends:   - pyinotify Python module >= 0.9.5
                      Severity: Minor
                      Found in salt/beacons/inotify.py - About 2 hrs to fix

                        File fx2.py has 269 lines of code (exceeds 250 allowed). Consider refactoring.
                        Open

                        # -*- coding: utf-8 -*-,
                        '''
                        Dell FX2 chassis
                        ================
                        
                        
                        Severity: Minor
                        Found in salt/proxy/fx2.py - About 2 hrs to fix

                          File lvm.py has 268 lines of code (exceeds 250 allowed). Consider refactoring.
                          Open

                          # -*- coding: utf-8 -*-
                          '''
                          Management of Linux logical volumes
                          ===================================
                          
                          
                          Severity: Minor
                          Found in salt/states/lvm.py - About 2 hrs to fix

                            File netntp.py has 268 lines of code (exceeds 250 allowed). Consider refactoring.
                            Open

                            # -*- coding: utf-8 -*-
                            '''
                            Network NTP
                            ===========
                            
                            
                            Severity: Minor
                            Found in salt/states/netntp.py - About 2 hrs to fix

                              File acme.py has 268 lines of code (exceeds 250 allowed). Consider refactoring.
                              Open

                              # -*- coding: utf-8 -*-
                              '''
                              ACME / Let's Encrypt module
                              ===========================
                              
                              
                              Severity: Minor
                              Found in salt/modules/acme.py - About 2 hrs to fix

                                Function _parse_requirements_file has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
                                Open

                                def _parse_requirements_file(requirements_file):
                                    parsed_requirements = []
                                    with open(requirements_file) as rfh:
                                        for line in rfh.readlines():
                                            line = line.strip()
                                Severity: Minor
                                Found in setup.py - About 2 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 handle_stream has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
                                Open

                                    def handle_stream(self, stream):
                                        '''
                                        Override this to handle the streams as they arrive
                                
                                        :param IOStream stream: An IOStream for processing
                                Severity: Minor
                                Found in salt/transport/ipc.py - About 2 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 _file_recv has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
                                Open

                                    def _file_recv(self, load):
                                        '''
                                        Allows minions to send files to the master, files are sent to the
                                        master file cache
                                        '''
                                Severity: Minor
                                Found in salt/master.py - About 2 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 _generate_report has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
                                Open

                                def _generate_report(ret, setup):
                                    '''
                                    Generate report dictionary
                                    '''
                                
                                
                                Severity: Minor
                                Found in salt/returners/highstate_return.py - About 2 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 _get_serv has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
                                Open

                                def _get_serv(ret=None, commit=False):
                                    '''
                                    Return a mysql cursor
                                    '''
                                    _options = _get_options(ret)
                                Severity: Minor
                                Found in salt/returners/mysql.py - About 2 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