saltstack/salt

View on GitHub

Showing 9,400 of 17,590 total issues

File azurearm.py has 1781 lines of code (exceeds 250 allowed). Consider refactoring.
Open

# -*- coding: utf-8 -*-
'''
Azure ARM Cloud Module
======================

Severity: Major
Found in salt/cloud/clouds/azurearm.py - About 4 days to fix

    File boto_ec2.py has 1757 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    # -*- coding: utf-8 -*-
    '''
    Connection module for Amazon EC2
    
    .. versionadded:: 2015.8.0
    Severity: Major
    Found in salt/modules/boto_ec2.py - About 4 days to fix

      File pkgng.py has 1755 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      # -*- coding: utf-8 -*-
      '''
      Support for ``pkgng``, the new package manager for FreeBSD
      
      .. important::
      Severity: Major
      Found in salt/modules/pkgng.py - About 4 days to fix

        Function check_perms has a Cognitive Complexity of 229 (exceeds 5 allowed). Consider refactoring.
        Open

        def check_perms(name, ret, user, group, mode, attrs=None, follow_symlinks=False, seuser=None,
                        serole=None, setype=None, serange=None):
            '''
            .. versionchanged:: Neon
        
        
        Severity: Minor
        Found in salt/modules/file.py - About 4 days 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 __init__.py has 1718 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        # -*- coding: utf-8 -*-
        '''
        The client module is used to create a client connection to the publisher
        The data structure needs to be:
            {'enc': 'clear',
        Severity: Major
        Found in salt/client/__init__.py - About 4 days to fix

          File bigip.py has 1714 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          # -*- coding: utf-8 -*-
          '''
          An execution module which can manipulate an f5 bigip via iControl REST
              :maturity:      develop
              :platform:      f5_bigip_11.6
          Severity: Major
          Found in salt/modules/bigip.py - About 4 days to fix

            Function _manage_devices has a Cognitive Complexity of 222 (exceeds 5 allowed). Consider refactoring.
            Open

            def _manage_devices(devices, vm=None, container_ref=None, new_vm_name=None):
                unit_number = 0
                bus_number = 0
                device_specs = []
                existing_disks_label = []
            Severity: Minor
            Found in salt/cloud/clouds/vmware.py - About 4 days 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 boto_apigateway.py has 1684 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            # -*- coding: utf-8 -*-
            '''
            Manage Apigateway Rest APIs
            ===========================
            
            
            Severity: Major
            Found in salt/states/boto_apigateway.py - About 4 days to fix

              File ipaddress.py has 1677 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              '''
              Python 2.[67] port of Python 3.4's ipaddress module
              
              Almost verbatim copy of the core lib, with compatibility changes
              Source: https://bitbucket.org/kwi/py2-ipaddress/
              Severity: Major
              Found in salt/ext/ipaddress.py - About 4 days to fix

                Function installed has a Cognitive Complexity of 220 (exceeds 5 allowed). Consider refactoring.
                Open

                def installed(
                        name,
                        version=None,
                        refresh=None,
                        fromrepo=None,
                Severity: Minor
                Found in salt/states/pkg.py - About 4 days 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 _check_perms has a Cognitive Complexity of 219 (exceeds 5 allowed). Consider refactoring.
                Open

                def _check_perms(obj_name, obj_type, new_perms, cur_perms, access_mode, ret):
                    '''
                    Helper function used by ``check_perms`` for checking and setting Grant and
                    Deny permissions.
                
                
                Severity: Minor
                Found in salt/utils/win_dacl.py - About 4 days 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 win_pkg.py has 1625 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                # -*- coding: utf-8 -*-
                '''
                A module to manage software on Windows
                
                .. important::
                Severity: Major
                Found in salt/modules/win_pkg.py - About 4 days to fix

                  File network.py has 1624 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  # -*- coding: utf-8 -*-
                  '''
                  Define some generic socket functions for network modules
                  '''
                  
                  
                  Severity: Major
                  Found in salt/utils/network.py - About 4 days to fix

                    Function install has a Cognitive Complexity of 213 (exceeds 5 allowed). Consider refactoring.
                    Open

                    def install(name=None,
                                refresh=False,
                                skip_verify=False,
                                pkgs=None,
                                sources=None,
                    Severity: Minor
                    Found in salt/modules/yumpkg.py - About 4 days 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 tls.py has 1617 lines of code (exceeds 250 allowed). Consider refactoring.
                    Open

                    # -*- coding: utf-8 -*-
                    r'''
                    A salt module for SSL/TLS.
                    Can create a Certificate Authority (CA)
                    or use Self-Signed certificates.
                    Severity: Major
                    Found in salt/modules/tls.py - About 4 days to fix

                      Function manage_file has a Cognitive Complexity of 211 (exceeds 5 allowed). Consider refactoring.
                      Open

                      def manage_file(name,
                                      sfn,
                                      ret,
                                      source,
                                      source_sum,
                      Severity: Minor
                      Found in salt/modules/file.py - About 4 days 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 loader.py has 1602 lines of code (exceeds 250 allowed). Consider refactoring.
                      Open

                      # -*- coding: utf-8 -*-
                      '''
                      The Salt loader is the core to Salt's plugin system, the loader scans
                      directories for python loadable code and organizes the code into the
                      plugin interfaces used by Salt.
                      Severity: Major
                      Found in salt/loader.py - About 4 days to fix

                        Function _check_directory_win has a Cognitive Complexity of 204 (exceeds 5 allowed). Consider refactoring.
                        Open

                        def _check_directory_win(name,
                                                 win_owner=None,
                                                 win_perms=None,
                                                 win_deny_perms=None,
                                                 win_inheritance=None,
                        Severity: Minor
                        Found in salt/states/file.py - About 4 days 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 debian_ip.py has 1555 lines of code (exceeds 250 allowed). Consider refactoring.
                        Open

                        # -*- coding: utf-8 -*-
                        '''
                        The networking module for Debian-based distros
                        
                        References:
                        Severity: Major
                        Found in salt/modules/debian_ip.py - About 4 days to fix

                          File boto_ec2.py has 1538 lines of code (exceeds 250 allowed). Consider refactoring.
                          Open

                          # -*- coding: utf-8 -*-
                          '''
                          Manage EC2
                          
                          .. versionadded:: 2015.8.0
                          Severity: Major
                          Found in salt/states/boto_ec2.py - About 4 days to fix
                            Severity
                            Category
                            Status
                            Source
                            Language