saltstack/salt

View on GitHub

Showing 9,400 of 17,590 total issues

Function get_url has a Cognitive Complexity of 117 (exceeds 5 allowed). Consider refactoring.
Open

    def get_url(self, url, dest, makedirs=False, saltenv='base',
                no_cache=False, cachedir=None, source_hash=None):
        '''
        Get a single file from a URL.
        '''
Severity: Minor
Found in salt/fileclient.py - About 2 days 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 __init__.py has 951 lines of code (exceeds 250 allowed). Consider refactoring.
Open

# -*- coding: utf-8 -*-
'''
This module provides the point of entry to SPM, the Salt Package Manager

.. versionadded:: 2015.8.0
Severity: Major
Found in salt/spm/__init__.py - About 2 days to fix

    File ebuildpkg.py has 950 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    # -*- coding: utf-8 -*-
    '''
    Support for Portage
    
    .. important::
    Severity: Major
    Found in salt/modules/ebuildpkg.py - About 2 days to fix

      File grafana4.py has 950 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      # -*- coding: utf-8 -*-
      '''
      Module for working with the Grafana v4 API
      
      .. versionadded:: 2017.7.0
      Severity: Major
      Found in salt/modules/grafana4.py - About 2 days to fix

        File state.py has 946 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        # -*- coding: utf-8 -*-
        '''
        Create ssh executor system
        '''
        from __future__ import absolute_import, print_function
        Severity: Major
        Found in salt/client/ssh/wrapper/state.py - About 2 days to fix

          Function Modernizr has a Cognitive Complexity of 115 (exceeds 5 allowed). Consider refactoring.
          Open

          window.Modernizr = (function( window, document, undefined ) {
          
              var version = '2.6.2',
          
              Modernizr = {},

          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 team_present has a Cognitive Complexity of 114 (exceeds 5 allowed). Consider refactoring.
          Open

          def team_present(
                  name,
                  description=None,
                  repo_names=None,
                  privacy='secret',
          Severity: Minor
          Found in salt/states/github.py - About 2 days 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 beacon has a Cognitive Complexity of 114 (exceeds 5 allowed). Consider refactoring.
          Open

          def beacon(config):
              '''
              Watch the configured files
          
              Example Config
          Severity: Minor
          Found in salt/beacons/inotify.py - About 2 days 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 restartcheck has a Cognitive Complexity of 112 (exceeds 5 allowed). Consider refactoring.
          Open

          def restartcheck(ignorelist=None, blacklist=None, excludepid=None, **kwargs):
              '''
              Analyzes files openeded by running processes and seeks for packages which need to be restarted.
          
              Args:
          Severity: Minor
          Found in salt/modules/restartcheck.py - About 2 days 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 request_instance has a Cognitive Complexity of 112 (exceeds 5 allowed). Consider refactoring.
          Open

          def request_instance(vm_=None, call=None):
              '''
              Put together all of the information necessary to request an instance on EC2,
              and then fire off the request the instance.
          
          
          Severity: Minor
          Found in salt/cloud/clouds/ec2.py - About 2 days 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 smartos.py has 919 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          # -*- coding: utf-8 -*-
          '''
          Management of SmartOS Standalone Compute Nodes
          
          :maintainer:    Jorge Schrauwen <sjorge@blackdot.be>
          Severity: Major
          Found in salt/states/smartos.py - About 2 days to fix

            File win.py has 914 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            # -*- coding: utf-8 -*-
            '''
            Windows specific utility functions, this module should be imported in a try,
            except block because it is only applicable on Windows platforms.
            
            
            Severity: Major
            Found in salt/platform/win.py - About 2 days to fix

              File netbox.py has 914 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              # -*- coding: utf-8 -*-
              '''
              NetBox
              ======
              
              
              Severity: Major
              Found in salt/modules/netbox.py - About 2 days to fix

                Function managed has a Cognitive Complexity of 111 (exceeds 5 allowed). Consider refactoring.
                Open

                def managed(name, roles=None, profiles=None, authorizations=None):
                    '''
                    Manage RBAC properties for user
                
                    name : string
                Severity: Minor
                Found in salt/states/rbac_solaris.py - About 2 days 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 present has a Cognitive Complexity of 111 (exceeds 5 allowed). Consider refactoring.
                Open

                def present(alias, passwd, usrgrps, medias=None, password_reset=False, **kwargs):
                    '''
                    Ensures that the user exists, eventually creates new user.
                    NOTE: use argument firstname instead of name to not mess values with name from salt sls.
                
                
                Severity: Minor
                Found in salt/states/zabbix_user.py - About 2 days 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 remove has a Cognitive Complexity of 111 (exceeds 5 allowed). Consider refactoring.
                Open

                def remove(name=None, pkgs=None, **kwargs):
                    '''
                    Remove the passed package(s) from the system using winrepo
                
                    .. versionadded:: 0.16.0
                Severity: Minor
                Found in salt/modules/win_pkg.py - About 2 days 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 elasticsearch.py has 908 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                # -*- coding: utf-8 -*-
                '''
                Elasticsearch - A distributed RESTful search and analytics server
                
                Module to provide Elasticsearch compatibility to Salt
                Severity: Major
                Found in salt/modules/elasticsearch.py - About 2 days to fix

                  Function process_results has a Cognitive Complexity of 110 (exceeds 5 allowed). Consider refactoring.
                  Open

                      def process_results(self, rows):
                          '''
                          This function takes a list of database results and iterates over,
                          merging them into a dict form.
                          '''
                  Severity: Minor
                  Found in salt/pillar/sql_base.py - About 2 days 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 pip_state.py has 906 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  # -*- coding: utf-8 -*-
                  '''
                  Installation of Python Packages Using pip
                  =========================================
                  
                  
                  Severity: Major
                  Found in salt/states/pip_state.py - About 2 days to fix

                    Function handle_func has a Cognitive Complexity of 109 (exceeds 5 allowed). Consider refactoring.
                    Open

                        def handle_func(self, multiprocessing_enabled, func, data):
                            '''
                            Execute this method in a multiprocess or thread
                            '''
                            if salt.utils.platform.is_windows() \
                    Severity: Minor
                    Found in salt/utils/schedule.py - About 2 days 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