saltstack/salt

View on GitHub

Showing 9,400 of 17,590 total issues

Function sign_in has a Cognitive Complexity of 38 (exceeds 5 allowed). Consider refactoring.
Open

    def sign_in(self, timeout=60, safe=True, tries=1, channel=None):
        '''
        Send a sign in request to the master, sets the key information and
        returns a dict containing the master publish interface to bind to
        and the decrypted aes key for transport decryption.
Severity: Minor
Found in salt/crypt.py - About 5 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

File ldap.py has 406 lines of code (exceeds 250 allowed). Consider refactoring.
Open

# -*- coding: utf-8 -*-
'''
Provide authentication using simple LDAP binds

:depends:   - ldap Python module
Severity: Minor
Found in salt/auth/ldap.py - About 5 hrs to fix

    File boto_elasticache.py has 406 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    # -*- coding: utf-8 -*-
    '''
    Manage Elasticache
    ==================
    
    
    Severity: Minor
    Found in salt/states/boto_elasticache.py - About 5 hrs to fix

      File ldap.py has 405 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      # -*- coding: utf-8 -*-
      '''
      Manage entries in an LDAP database
      ==================================
      
      
      Severity: Minor
      Found in salt/states/ldap.py - About 5 hrs to fix

        File httpdomain.py has 404 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        """
            sphinxcontrib.httpdomain
            ~~~~~~~~~~~~~~~~~~~~~~~~
        
            The HTTP domain for documenting RESTful HTTP APIs.
        Severity: Minor
        Found in doc/_ext/httpdomain.py - About 5 hrs to fix

          File auth.py has 404 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          # -*- coding: utf-8 -*-
          
          # Import Python Libs
          from __future__ import absolute_import, print_function, unicode_literals
          import multiprocessing
          Severity: Minor
          Found in salt/transport/mixins/auth.py - About 5 hrs to fix

            File neutronng.py has 403 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            # -*- coding: utf-8 -*-
            '''
            Neutron module for interacting with OpenStack Neutron
            
            .. versionadded:: 2018.3.0
            Severity: Minor
            Found in salt/modules/neutronng.py - About 5 hrs to fix

              File dpkg_lowpkg.py has 403 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              # -*- coding: utf-8 -*-
              '''
              Support for DEB packages
              '''
              from __future__ import absolute_import, print_function, unicode_literals
              Severity: Minor
              Found in salt/modules/dpkg_lowpkg.py - About 5 hrs to fix

                File onyx.py has 403 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                # -*- coding: utf-8 -*-
                '''
                Proxy Minion for Onyx OS Switches
                
                .. versionadded: Neon
                Severity: Minor
                Found in salt/proxy/onyx.py - About 5 hrs to fix

                  File win_lgpo_netsh.py has 402 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  # -*- coding: utf-8 -*-
                  r'''
                  A salt util for modifying firewall settings.
                  
                  .. versionadded:: 2018.3.4
                  Severity: Minor
                  Found in salt/utils/win_lgpo_netsh.py - About 5 hrs to fix

                    File zabbix_host.py has 401 lines of code (exceeds 250 allowed). Consider refactoring.
                    Open

                    # -*- coding: utf-8 -*-
                    '''
                    Management of Zabbix hosts.
                    
                    :codeauthor: Jiri Kotlin <jiri.kotlin@ultimum.io>
                    Severity: Minor
                    Found in salt/states/zabbix_host.py - About 5 hrs to fix

                      File sqlite3.py has 401 lines of code (exceeds 250 allowed). Consider refactoring.
                      Open

                      # -*- coding: utf-8 -*-
                      '''
                      Management of SQLite3 databases
                      ===============================
                      
                      
                      Severity: Minor
                      Found in salt/states/sqlite3.py - About 5 hrs to fix

                        File zoneadm.py has 400 lines of code (exceeds 250 allowed). Consider refactoring.
                        Open

                        # -*- coding: utf-8 -*-
                        '''
                        Module for Solaris 10's zoneadm
                        
                        :maintainer:    Jorge Schrauwen <sjorge@blackdot.be>
                        Severity: Minor
                        Found in salt/modules/zoneadm.py - About 5 hrs to fix

                          Function datasource_exists has a Cognitive Complexity of 37 (exceeds 5 allowed). Consider refactoring.
                          Open

                          def datasource_exists(name, jboss_config, datasource_properties, recreate=False, profile=None):
                              '''
                              Ensures that a datasource with given properties exist on the jboss instance.
                              If datasource doesn't exist, it is created, otherwise only the properties that are different will be updated.
                          
                          
                          Severity: Minor
                          Found in salt/states/jboss7.py - About 5 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 mod_run_check has a Cognitive Complexity of 37 (exceeds 5 allowed). Consider refactoring.
                          Open

                          def mod_run_check(cmd_kwargs, onlyif, unless, creates):
                              '''
                              Execute the onlyif and unless logic.
                              Return a result dict if:
                              * onlyif failed (onlyif != 0)
                          Severity: Minor
                          Found in salt/states/cmd.py - About 5 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 _subnets_present has a Cognitive Complexity of 37 (exceeds 5 allowed). Consider refactoring.
                          Open

                          def _subnets_present(route_table_name, subnet_ids=None, subnet_names=None, tags=None, region=None, key=None, keyid=None, profile=None):
                              ret = {'name': route_table_name,
                                     'result': True,
                                     'comment': '',
                                     'changes': {}
                          Severity: Minor
                          Found in salt/states/boto_vpc.py - About 5 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 _task_state_prediction_bandage has a Cognitive Complexity of 37 (exceeds 5 allowed). Consider refactoring.
                          Open

                          def _task_state_prediction_bandage(state):
                              r'''
                              A bandage to format and add arguments to a task state.
                              This is so task states can be compared.
                          
                          
                          Severity: Minor
                          Found in salt/states/win_task.py - About 5 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 installed has a Cognitive Complexity of 37 (exceeds 5 allowed). Consider refactoring.
                          Open

                          def installed(name, options=None):
                              '''
                              Verify that the desired port is installed, and that it was compiled with
                              the desired options.
                          
                          
                          Severity: Minor
                          Found in salt/states/ports.py - About 5 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 encode_dict has a Cognitive Complexity of 37 (exceeds 5 allowed). Consider refactoring.
                          Open

                          def encode_dict(data, encoding=None, errors='strict', keep=False,
                                          preserve_dict_class=False, preserve_tuples=False):
                              '''
                              Encode all string values to bytes
                              '''
                          Severity: Minor
                          Found in salt/utils/data.py - About 5 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 versions has a Cognitive Complexity of 37 (exceeds 5 allowed). Consider refactoring.
                          Open

                          def versions():
                              '''
                              Figure out what versions of .NET are installed on the system
                          
                              Returns:
                          Severity: Minor
                          Found in salt/utils/win_dotnet.py - About 5 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