saltstack/salt

View on GitHub

Showing 9,400 of 17,590 total issues

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

def add_host(kwargs=None, call=None):
    '''
    Add a host system to the specified cluster or datacenter in this VMware environment

    .. note::
Severity: Minor
Found in salt/cloud/clouds/vmware.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 list_nodes has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
Open

def list_nodes(call=None, **kwargs):
    '''
    Return a list of the VMs that in this location
    '''
    if call == 'action':
Severity: Minor
Found in salt/cloud/clouds/nova.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 list_env has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
Open

def list_env(saltenv='base'):
    '''
    Return all of the file paths found in an environment
    '''
    ret = {}
Severity: Minor
Found in salt/wheel/file_roots.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 list_env has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
Open

def list_env(saltenv='base'):
    '''
    Return all of the file paths found in an environment
    '''
    ret = {}
Severity: Minor
Found in salt/wheel/pillar_roots.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 list_vms has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
Open

def list_vms(search=None, verbose=False):
    '''
    List all vms

    search : string
Severity: Minor
Found in salt/runners/smartos_vmadm.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 clear_git_lock has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
Open

def clear_git_lock(role, remote=None, **kwargs):
    '''
    .. versionadded:: 2015.8.2

    Remove the update locks for Salt components (gitfs, git_pillar, winrepo)
Severity: Minor
Found in salt/runners/cache.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 exec_lowstate has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
Open

    def exec_lowstate(self, client=None, token=None):
        '''
        Pull a Low State data structure from request and execute the low-data
        chunks through Salt. The low-data chunks will be updated to include the
        authorization token for the current session.
Severity: Minor
Found in salt/netapi/rest_cherrypy/app.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 load_modules has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
Open

    def load_modules(self, data=None, proxy=None):
        '''
        Load the modules into the state
        '''
        log.info('Loading fresh modules for state activity')
Severity: Minor
Found in salt/state.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 run has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
Open

    def run(self):
        exit_code = salt.defaults.exitcodes.EX_OK
        self.out = salt.cli.support.console.MessagesOutput()
        try:
            self.parse_args()
Severity: Minor
Found in salt/cli/support/collector.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

File composer.py has 322 lines of code (exceeds 250 allowed). Consider refactoring.
Open

# -*- coding: utf-8 -*-
'''
Use composer to install PHP dependencies for a directory
'''
from __future__ import absolute_import, print_function, unicode_literals
Severity: Minor
Found in salt/modules/composer.py - About 3 hrs to fix

    File logstash_mod.py has 321 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    # -*- coding: utf-8 -*-
    '''
        Logstash Logging Handler
        ========================
    
    
    Severity: Minor
    Found in salt/log/handlers/logstash_mod.py - About 3 hrs to fix

      File drac.py has 321 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      # -*- coding: utf-8 -*-
      '''
      Manage Dell DRAC
      '''
      
      
      Severity: Minor
      Found in salt/modules/drac.py - About 3 hrs to fix

        File csf.py has 320 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        # -*- coding: utf-8 -*-
        '''
        CSF Ip tables management
        ========================
        
        
        Severity: Minor
        Found in salt/states/csf.py - About 3 hrs to fix

          File pagerduty_util.py has 320 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          # -*- coding: utf-8 -*-
          '''
          Module for manageing PagerDuty resource
          
          :configuration: This module can be used by specifying the name of a
          Severity: Minor
          Found in salt/modules/pagerduty_util.py - About 3 hrs to fix

            File netusers.py has 319 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

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

              File mysql_query.py has 319 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              # -*- coding: utf-8 -*-
              '''
              Execution of MySQL queries
              ==========================
              
              
              Severity: Minor
              Found in salt/states/mysql_query.py - About 3 hrs to fix

                File pcs.py has 319 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                # -*- coding: utf-8 -*-
                '''
                Configure a Pacemaker/Corosync cluster with PCS
                ===============================================
                
                
                Severity: Minor
                Found in salt/modules/pcs.py - About 3 hrs to fix

                  File zabbix_mediatype.py has 317 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  # -*- coding: utf-8 -*-
                  '''
                  Management of Zabbix mediatypes.
                  
                  :codeauthor: Raymond Kuiper <qix@the-wired.net>
                  Severity: Minor
                  Found in salt/states/zabbix_mediatype.py - About 3 hrs to fix

                    File lvs.py has 317 lines of code (exceeds 250 allowed). Consider refactoring.
                    Open

                    # -*- coding: utf-8 -*-
                    '''
                    Support for LVS (Linux Virtual Server)
                    '''
                    from __future__ import absolute_import, print_function, unicode_literals
                    Severity: Minor
                    Found in salt/modules/lvs.py - About 3 hrs to fix

                      File mac_softwareupdate.py has 317 lines of code (exceeds 250 allowed). Consider refactoring.
                      Open

                      # -*- coding: utf-8 -*-
                      '''
                      Support for the softwareupdate command on MacOS.
                      '''
                      from __future__ import absolute_import, unicode_literals, print_function
                      Severity: Minor
                      Found in salt/modules/mac_softwareupdate.py - About 3 hrs to fix
                        Severity
                        Category
                        Status
                        Source
                        Language