saltstack/salt

View on GitHub

Showing 9,400 of 17,590 total issues

Function hdparms has a Cognitive Complexity of 53 (exceeds 5 allowed). Consider refactoring.
Open

def hdparms(disks, args=None):
    '''
    Retrieve all info's for all disks
    parse 'em into a nice dict
    (which, considering hdparms output, is quite a hassle)
Severity: Minor
Found in salt/modules/disk.py - About 1 day 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 _handle_iorder has a Cognitive Complexity of 53 (exceeds 5 allowed). Consider refactoring.
Open

    def _handle_iorder(self, state):
        '''
        Take a state and apply the iorder system
        '''
        if self.opts['state_auto_order']:
Severity: Minor
Found in salt/state.py - About 1 day 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 makeconf.py has 510 lines of code (exceeds 250 allowed). Consider refactoring.
Open

# -*- coding: utf-8 -*-
'''
Support for modifying make.conf under Gentoo

'''
Severity: Major
Found in salt/modules/makeconf.py - About 1 day to fix

    File ssh_auth.py has 509 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    # -*- coding: utf-8 -*-
    '''
    Control of entries in SSH authorized_key files
    ==============================================
    
    
    Severity: Major
    Found in salt/states/ssh_auth.py - About 1 day to fix

      File win_firewall.py has 508 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      # -*- coding: utf-8 -*-
      '''
      Module for configuring Windows Firewall using ``netsh``
      '''
      from __future__ import absolute_import, unicode_literals, print_function
      Severity: Major
      Found in salt/modules/win_firewall.py - About 1 day to fix

        File parallels.py has 508 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        # -*- coding: utf-8 -*-
        '''
        Manage Parallels Desktop VMs with ``prlctl`` and ``prlsrvctl``.  Only some of
        the prlctl commands implemented so far.  Of those that have been implemented,
        not all of the options may have been provided yet.  For a complete reference,
        Severity: Major
        Found in salt/modules/parallels.py - About 1 day to fix

          File pkgrepo.py has 506 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          # -*- coding: utf-8 -*-
          '''
          Management of APT/DNF/YUM/Zypper package repos
          ==============================================
          
          
          Severity: Major
          Found in salt/states/pkgrepo.py - About 1 day to fix

            File libvirt.py has 506 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            # -*- coding: utf-8 -*-
            '''
            Libvirt Cloud Module
            ====================
            
            
            Severity: Major
            Found in salt/cloud/clouds/libvirt.py - About 1 day to fix

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

              # -*- coding: utf-8 -*-
              '''
              Azure (ARM) Compute Execution Module
              
              .. versionadded:: 2019.2.0
              Severity: Major
              Found in salt/modules/azurearm_compute.py - About 1 day to fix

                Function _stream_return has a Cognitive Complexity of 52 (exceeds 5 allowed). Consider refactoring.
                Open

                    def _stream_return(self):
                        try:
                            while not self._closing and (
                                    not self._connecting_future.done() or
                                    self._connecting_future.result() is not True):
                Severity: Minor
                Found in salt/transport/tcp.py - About 1 day 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_tcp_keepalive has a Cognitive Complexity of 52 (exceeds 5 allowed). Consider refactoring.
                Open

                def _set_tcp_keepalive(sock, opts):
                    '''
                    Ensure that TCP keepalives are set for the socket.
                    '''
                    if hasattr(socket, 'SO_KEEPALIVE'):
                Severity: Minor
                Found in salt/transport/tcp.py - About 1 day 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 52 (exceeds 5 allowed). Consider refactoring.
                Open

                def present(name, Name,
                           S3BucketName, S3KeyPrefix=None,
                           SnsTopicName=None,
                           IncludeGlobalServiceEvents=True,
                           IsMultiRegionTrail=None,
                Severity: Minor
                Found in salt/states/boto_cloudtrail.py - About 1 day 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 deployed has a Cognitive Complexity of 52 (exceeds 5 allowed). Consider refactoring.
                Open

                def deployed(name, template=None, environment=None, params=None, poll=5,
                             rollback=False, timeout=60, update=False, profile=None,
                             **connection_args):
                    '''
                    Deploy stack with the specified properties
                Severity: Minor
                Found in salt/states/heat.py - About 1 day 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 import_ has a Cognitive Complexity of 52 (exceeds 5 allowed). Consider refactoring.
                Open

                def import_(name, path, mode='import', nodataset=False, brand_opts=None):
                    '''
                    Import a zones configuration
                
                    name : string
                Severity: Minor
                Found in salt/states/zone.py - About 1 day 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 _gen_recurse_managed_files has a Cognitive Complexity of 52 (exceeds 5 allowed). Consider refactoring.
                Open

                def _gen_recurse_managed_files(
                        name,
                        source,
                        keep_symlinks=False,
                        include_pat=None,
                Severity: Minor
                Found in salt/states/file.py - About 1 day 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 52 (exceeds 5 allowed). Consider refactoring.
                Open

                def present(name, Name=None,
                           ScheduleExpression=None,
                           EventPattern=None,
                           Description=None,
                           RoleArn=None,
                Severity: Minor
                Found in salt/states/boto_cloudwatch_event.py - About 1 day 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 unmounted has a Cognitive Complexity of 52 (exceeds 5 allowed). Consider refactoring.
                Open

                def unmounted(name,
                              device=None,
                              config='/etc/fstab',
                              persist=False,
                              user=None,
                Severity: Minor
                Found in salt/states/mount.py - About 1 day 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_instance has a Cognitive Complexity of 52 (exceeds 5 allowed). Consider refactoring.
                Open

                def wait_for_instance(
                        vm_=None,
                        data=None,
                        ip_address=None,
                        display_ssh_output=True,
                Severity: Minor
                Found in salt/cloud/clouds/ec2.py - About 1 day 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 lldp has a Cognitive Complexity of 52 (exceeds 5 allowed). Consider refactoring.
                Open

                def lldp(device=None,
                         interface=None,
                         title=None,
                         pattern=None,
                         chassis=None,
                Severity: Minor
                Found in salt/runners/net.py - About 1 day 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 _handle_tag_master_disconnected_failback has a Cognitive Complexity of 52 (exceeds 5 allowed). Consider refactoring.
                Open

                    def _handle_tag_master_disconnected_failback(self, tag, data):
                        '''
                        Handle a master_disconnected_failback event
                        '''
                        # if the master disconnect event is for a different master, raise an exception
                Severity: Minor
                Found in salt/minion.py - About 1 day 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