saltstack/salt

View on GitHub

Showing 9,400 of 17,590 total issues

Function list_worktrees has a Cognitive Complexity of 96 (exceeds 5 allowed). Consider refactoring.
Open

def list_worktrees(cwd,
                   stale=False,
                   user=None,
                   password=None,
                   output_encoding=None,
Severity: Minor
Found in salt/modules/git.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 zfs.py has 807 lines of code (exceeds 250 allowed). Consider refactoring.
Open

# -*- coding: utf-8 -*-
'''
States for managing zfs datasets

:maintainer:    Jorge Schrauwen <sjorge@blackdot.be>
Severity: Major
Found in salt/states/zfs.py - About 1 day to fix

    Function _parser has 384 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    def _parser():
        '''
        This function attempts to list all the options documented in the
        iptables(8) and iptables-extensions(8) man pages.  They will not all be
        used by all parts of the module; use them intelligently and appropriately.
    Severity: Major
    Found in salt/modules/iptables.py - About 1 day to fix

      File jinja.py has 805 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      # -*- coding: utf-8 -*-
      '''
      Jinja loading utils to enable a more powerful backend for jinja templates
      '''
      
      
      Severity: Major
      Found in salt/utils/jinja.py - About 1 day to fix

        File neutron.py has 803 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        # -*- coding: utf-8 -*-
        '''
        Neutron class
        '''
        
        
        Severity: Major
        Found in salt/utils/openstack/neutron.py - About 1 day to fix

          Function mod_watch has a Cognitive Complexity of 95 (exceeds 5 allowed). Consider refactoring.
          Open

          def mod_watch(name,
                        sfun=None,
                        sig=None,
                        full_restart=False,
                        init_delay=None,
          Severity: Minor
          Found in salt/states/service.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 __collect_software_info has a Cognitive Complexity of 95 (exceeds 5 allowed). Consider refactoring.
          Open

              def __collect_software_info(self, sid, key_software, use_32bit):
                  '''
                  Update data with the next software found
                  '''
          
          
          Severity: Minor
          Found in salt/utils/pkg/win.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 _apply_cluster_dict has a Cognitive Complexity of 95 (exceeds 5 allowed). Consider refactoring.
          Open

          def _apply_cluster_dict(cluster_spec, cluster_dict, vsan_spec=None,
                                  vsan_61=True):
              '''
              Applies the values of cluster_dict dictionary to a cluster spec
              (vim.ClusterConfigSpecEx).
          Severity: Minor
          Found in salt/modules/vsphere.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 boto_lambda.py has 802 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          # -*- coding: utf-8 -*-
          '''
          Manage Lambda Functions
          =======================
          
          
          Severity: Major
          Found in salt/states/boto_lambda.py - About 1 day to fix

            File cassandra_cql.py has 802 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            # -*- coding: utf-8 -*-
            '''
            Cassandra Database Module
            
            .. versionadded:: 2015.5.0
            Severity: Major
            Found in salt/modules/cassandra_cql.py - About 1 day to fix

              File win_useradd.py has 799 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              # -*- coding: utf-8 -*-
              '''
              Module for managing Windows Users
              
              .. important::
              Severity: Major
              Found in salt/modules/win_useradd.py - About 1 day to fix

                Function user_present has a Cognitive Complexity of 94 (exceeds 5 allowed). Consider refactoring.
                Open

                def user_present(name,
                                 password,
                                 email,
                                 tenant=None,
                                 enabled=True,
                Severity: Minor
                Found in salt/states/keystone.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 _check_compound_minions has a Cognitive Complexity of 94 (exceeds 5 allowed). Consider refactoring.
                Open

                    def _check_compound_minions(self,
                                                expr,
                                                delimiter,
                                                greedy,
                                                pillar_exact=False):  # pylint: disable=unused-argument
                Severity: Minor
                Found in salt/utils/minions.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 _format_instance_info_select has a Cognitive Complexity of 94 (exceeds 5 allowed). Consider refactoring.
                Open

                def _format_instance_info_select(vm, selection):
                    def defaultto(machine, section, default='N/A'):
                        '''
                        Return either a named value from a VirtualMachineConfig or a
                        default string "N/A".
                Severity: Minor
                Found in salt/cloud/clouds/vmware.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 boto3_route53.py has 792 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                # -*- coding: utf-8 -*-
                '''
                Execution module for Amazon Route53 written against Boto 3
                
                .. versionadded:: 2017.7.0
                Severity: Major
                Found in salt/modules/boto3_route53.py - About 1 day to fix

                  File kubernetes.py has 791 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  # -*- coding: utf-8 -*-
                  '''
                  Manage kubernetes resources as salt states
                  ==========================================
                  
                  
                  Severity: Major
                  Found in salt/states/kubernetes.py - About 1 day to fix

                    File pacmanpkg.py has 791 lines of code (exceeds 250 allowed). Consider refactoring.
                    Open

                    # -*- coding: utf-8 -*-
                    '''
                    A module to wrap pacman calls, since Arch is the best
                    (https://wiki.archlinux.org/index.php/Arch_is_the_best)
                    
                    
                    Severity: Major
                    Found in salt/modules/pacmanpkg.py - About 1 day to fix

                      Function request_instance has a Cognitive Complexity of 93 (exceeds 5 allowed). Consider refactoring.
                      Open

                      def request_instance(vm_):
                          '''
                          Request a VM from Azure.
                          '''
                          compconn = get_conn(client_type='compute')
                      Severity: Minor
                      Found in salt/cloud/clouds/azurearm.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 netacl.py has 786 lines of code (exceeds 250 allowed). Consider refactoring.
                      Open

                      # -*- coding: utf-8 -*-
                      '''
                      Network ACL
                      ===========
                      
                      
                      Severity: Major
                      Found in salt/states/netacl.py - About 1 day to fix

                        File user.py has 783 lines of code (exceeds 250 allowed). Consider refactoring.
                        Open

                        # -*- coding: utf-8 -*-
                        '''
                        Management of user accounts
                        ===========================
                        
                        
                        Severity: Major
                        Found in salt/states/user.py - About 1 day to fix
                          Severity
                          Category
                          Status
                          Source
                          Language