saltstack/salt

View on GitHub

Showing 9,400 of 17,590 total issues

File docker_image.py has 418 lines of code (exceeds 250 allowed). Consider refactoring.
Open

# -*- coding: utf-8 -*-
'''
Management of Docker images

.. versionadded:: 2017.7.0
Severity: Minor
Found in salt/states/docker_image.py - About 6 hrs to fix

    File vsan.py has 418 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    # -*- coding: utf-8 -*-
    '''
    Connection library for VMware vSAN endpoint
    
    This library used the vSAN extension of the VMware SDK
    Severity: Minor
    Found in salt/utils/vsan.py - About 6 hrs to fix

      File xbpspkg.py has 418 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      # -*- coding: utf-8 -*-
      '''
      Package support for XBPS package manager (used by VoidLinux)
      
      .. versionadded:: 2016.11.0
      Severity: Minor
      Found in salt/modules/xbpspkg.py - About 6 hrs to fix

        File local_cache.py has 417 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        # -*- coding: utf-8 -*-
        '''
        Return data to local job cache
        
        '''
        Severity: Minor
        Found in salt/returners/local_cache.py - About 6 hrs to fix

          File reactor.py has 415 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          # -*- coding: utf-8 -*-
          '''
          Functions which implement running reactor jobs
          '''
          
          
          Severity: Minor
          Found in salt/utils/reactor.py - About 5 hrs to fix

            File gogrid.py has 415 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

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

              File cloud.py has 414 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              # -*- coding: utf-8 -*-
              '''
              Using states instead of maps to deploy clouds
              =============================================
              
              
              Severity: Minor
              Found in salt/states/cloud.py - About 5 hrs to fix

                File postfix.py has 414 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                # -*- coding: utf-8 -*-
                '''
                Support for Postfix
                
                This module is currently little more than a config file viewer and editor. It
                Severity: Minor
                Found in salt/modules/postfix.py - About 5 hrs to fix

                  Function _minion_lookup has a Cognitive Complexity of 39 (exceeds 5 allowed). Consider refactoring.
                  Open

                  def _minion_lookup(minion_id, key, minion):
                      grains, pillar, addrs, mine = minion
                  
                      if key == 'id':
                          # Just paste in the minion ID
                  Severity: Minor
                  Found in salt/roster/cache.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 stopped has a Cognitive Complexity of 39 (exceeds 5 allowed). Consider refactoring.
                  Open

                  def stopped(name=None,
                              containers=None,
                              shutdown_timeout=None,
                              unpause=False,
                              error_on_absent=True,
                  Severity: Minor
                  Found in salt/states/docker_container.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 dead has a Cognitive Complexity of 39 (exceeds 5 allowed). Consider refactoring.
                  Open

                  def dead(name,
                           enable=None,
                           sig=None,
                           init_delay=None,
                           **kwargs):
                  Severity: Minor
                  Found in salt/states/service.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 running has a Cognitive Complexity of 39 (exceeds 5 allowed). Consider refactoring.
                  Open

                  def running(name,
                              enable=None,
                              sig=None,
                              init_delay=None,
                              no_block=False,
                  Severity: Minor
                  Found in salt/states/service.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 _get_task_state_prediction has a Cognitive Complexity of 39 (exceeds 5 allowed). Consider refactoring.
                  Open

                  def _get_task_state_prediction(state,
                                                new_task):
                      r'''
                          predicts what a the new task will look like
                  
                  
                  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 index_template_present has a Cognitive Complexity of 39 (exceeds 5 allowed). Consider refactoring.
                  Open

                  def index_template_present(name, definition, check_definition=False):
                      '''
                      Ensure that the named index template is present.
                  
                      name
                  Severity: Minor
                  Found in salt/states/elasticsearch.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 config_set has a Cognitive Complexity of 39 (exceeds 5 allowed). Consider refactoring.
                  Open

                  def config_set(name,
                                 value=None,
                                 multivar=None,
                                 repo=None,
                                 user=None,
                  Severity: Minor
                  Found in salt/states/git.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 parameter_present has a Cognitive Complexity of 39 (exceeds 5 allowed). Consider refactoring.
                  Open

                  def parameter_present(name, db_parameter_group_family, description, parameters=None,
                                        apply_method="pending-reboot", tags=None, region=None, key=None, keyid=None, profile=None):
                      '''
                      Ensure DB parameter group exists and update parameters.
                  
                  
                  Severity: Minor
                  Found in salt/states/boto_rds.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 wait_for_port has a Cognitive Complexity of 39 (exceeds 5 allowed). Consider refactoring.
                  Open

                  def wait_for_port(host, port=22, timeout=900, gateway=None):
                      '''
                      Wait until a connection to the specified port can be made on a specified
                      host. This is usually port 22 (for SSH), but in the case of Windows
                      installations, it might be port 445 (for psexec). It may also be an
                  Severity: Minor
                  Found in salt/utils/cloud.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 __set_attributes__ has a Cognitive Complexity of 39 (exceeds 5 allowed). Consider refactoring.
                  Open

                      def __set_attributes__(cls):
                          match_info = []
                          grain_targets = set()
                  
                          # find all of our filters
                  Severity: Minor
                  Found in salt/utils/pyobjects.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 auth_check_expanded has a Cognitive Complexity of 39 (exceeds 5 allowed). Consider refactoring.
                  Open

                      def auth_check_expanded(self,
                                              auth_list,
                                              funs,
                                              args,
                                              tgt,
                  Severity: Minor
                  Found in salt/utils/minions.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 _lock has a Cognitive Complexity of 39 (exceeds 5 allowed). Consider refactoring.
                  Open

                      def _lock(self, lock_type='update', failhard=False):
                          '''
                          Place a lock file if (and only if) it does not already exist.
                          '''
                          try:
                  Severity: Minor
                  Found in salt/utils/gitfs.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