saltstack/salt

View on GitHub

Showing 9,400 of 17,590 total issues

File publish.py has 260 lines of code (exceeds 250 allowed). Consider refactoring.
Open

# -*- coding: utf-8 -*-
'''
Publish a command from a minion to a target
'''
from __future__ import absolute_import, unicode_literals, print_function
Severity: Minor
Found in salt/modules/publish.py - About 2 hrs to fix

    File azurearm_compute.py has 259 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    # -*- coding: utf-8 -*-
    '''
    Azure (ARM) Compute State Module
    
    .. versionadded:: 2019.2.0
    Severity: Minor
    Found in salt/states/azurearm_compute.py - About 2 hrs to fix

      File postgres_user.py has 259 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      # -*- coding: utf-8 -*-
      '''
      Management of PostgreSQL users (roles)
      ======================================
      
      
      Severity: Minor
      Found in salt/states/postgres_user.py - About 2 hrs to fix

        File boto_sqs.py has 259 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        # -*- coding: utf-8 -*-
        '''
        Manage SQS Queues
        
        .. versionadded:: 2014.7.0
        Severity: Minor
        Found in salt/states/boto_sqs.py - About 2 hrs to fix

          File odict.py has 259 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          # -*- coding: utf-8 -*-
          '''
              :codeauthor: Pedro Algarvio (pedro@algarvio.me)
          
          
          
          Severity: Minor
          Found in salt/utils/odict.py - About 2 hrs to fix

            File helpers.py has 259 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            # -*- coding: utf-8 -*-
            '''
            Functions to translate input in the docker CLI format to the format desired by
            by the API.
            '''
            Severity: Minor
            Found in salt/utils/docker/translate/helpers.py - About 2 hrs to fix

              File btmp.py has 259 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              # -*- coding: utf-8 -*-
              '''
              Beacon to fire events at failed login of users
              
              .. versionadded:: 2015.5.0
              Severity: Minor
              Found in salt/beacons/btmp.py - About 2 hrs to fix

                File __init__.py has 258 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                # -*- coding: utf-8 -*-
                '''
                Common logic used by the docker state and execution module
                
                This module contains logic to accommodate docker/salt CLI usage, as well as
                Severity: Minor
                Found in salt/utils/docker/__init__.py - About 2 hrs to fix

                  File postgres_privileges.py has 257 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  # -*- coding: utf-8 -*-
                  '''
                  Management of PostgreSQL Privileges
                  ===================================
                  
                  
                  Severity: Minor
                  Found in salt/states/postgres_privileges.py - About 2 hrs to fix

                    SaltStackVersion has 21 functions (exceeds 20 allowed). Consider refactoring.
                    Open

                    class SaltStackVersion(object):
                        '''
                        Handle SaltStack versions class.
                    
                        Knows how to parse ``git describe`` output, knows about release candidates
                    Severity: Minor
                    Found in salt/version.py - About 2 hrs to fix

                      File s3.py has 256 lines of code (exceeds 250 allowed). Consider refactoring.
                      Open

                      # -*- coding: utf-8 -*-
                      '''
                      Connection module for Amazon S3
                      
                      :configuration: This module accepts explicit s3 credentials but can also utilize
                      Severity: Minor
                      Found in salt/modules/s3.py - About 2 hrs to fix

                        File vbox_guest.py has 256 lines of code (exceeds 250 allowed). Consider refactoring.
                        Open

                        # -*- coding: utf-8 -*-
                        '''
                        VirtualBox Guest Additions installer
                        '''
                        from __future__ import absolute_import, print_function, unicode_literals
                        Severity: Minor
                        Found in salt/modules/vbox_guest.py - About 2 hrs to fix

                          File gentoo_service.py has 255 lines of code (exceeds 250 allowed). Consider refactoring.
                          Open

                          # -*- coding: utf-8 -*-
                          '''
                          Top level package command wrapper, used to translate the os detected by grains
                          to the correct service manager
                          
                          
                          Severity: Minor
                          Found in salt/modules/gentoo_service.py - About 2 hrs to fix

                            File vagrant.py has 255 lines of code (exceeds 250 allowed). Consider refactoring.
                            Open

                            # -*- coding: utf-8 -*-
                            '''
                            Vagrant Cloud Driver
                            ====================
                            
                            
                            Severity: Minor
                            Found in salt/cloud/clouds/vagrant.py - About 2 hrs to fix

                              File slack_webhook_return.py has 254 lines of code (exceeds 250 allowed). Consider refactoring.
                              Open

                              # -*- coding: utf-8 -*-
                              '''
                              Return salt data via Slack using Incoming Webhooks
                              
                              :codeauthor: `Carlos D. Álvaro <github@cdalvaro.io>`
                              Severity: Minor
                              Found in salt/returners/slack_webhook_return.py - About 2 hrs to fix

                                File win_smtp_server.py has 254 lines of code (exceeds 250 allowed). Consider refactoring.
                                Open

                                # -*- coding: utf-8 -*-
                                '''
                                Module for managing IIS SMTP server configuration on Windows servers.
                                
                                '''
                                Severity: Minor
                                Found in salt/states/win_smtp_server.py - About 2 hrs to fix

                                  File saltutil.py has 254 lines of code (exceeds 250 allowed). Consider refactoring.
                                  Open

                                  # -*- coding: utf-8 -*-
                                  '''
                                  Saltutil State
                                  ==============
                                  
                                  
                                  Severity: Minor
                                  Found in salt/states/saltutil.py - About 2 hrs to fix

                                    File beacon.py has 254 lines of code (exceeds 250 allowed). Consider refactoring.
                                    Open

                                    # -*- coding: utf-8 -*-
                                    '''
                                    Management of the Salt beacons
                                    ==============================
                                    
                                    
                                    Severity: Minor
                                    Found in salt/states/beacon.py - About 2 hrs to fix

                                      Function _stream_send has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
                                      Open

                                          def _stream_send(self):
                                              while not self._connecting_future.done() or self._connecting_future.result() is not True:
                                                  yield self._connecting_future
                                              while self.send_queue:
                                                  message_id, item = self.send_queue[0]
                                      Severity: Minor
                                      Found in salt/transport/tcp.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 fill_buckets has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
                                      Open

                                          def fill_buckets(self):
                                              '''
                                              Get the configured backends and the intervals for any backend which
                                              supports them, and set up the update "buckets". There will be one
                                              bucket for each thing being updated at a given interval.
                                      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

                                      Severity
                                      Category
                                      Status
                                      Source
                                      Language