saltstack/salt

View on GitHub

Showing 9,400 of 17,590 total issues

Function user_absent has a Cognitive Complexity of 66 (exceeds 5 allowed). Consider refactoring.
Open

def user_absent(name, delete_keys=True, delete_mfa_devices=True, delete_profile=True, region=None, key=None, keyid=None, profile=None):
    '''

    .. versionadded:: 2015.8.0

Severity: Minor
Found in salt/states/boto_iam.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 storage_policies_configured has a Cognitive Complexity of 66 (exceeds 5 allowed). Consider refactoring.
Open

def storage_policies_configured(name, policies):
    '''
    Configures storage policies on a vCenter.

    policies
Severity: Minor
Found in salt/states/pbm.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 save has a Cognitive Complexity of 66 (exceeds 5 allowed). Consider refactoring.
Open

def save(name,
         path,
         overwrite=False,
         makedirs=False,
         compression=None,
Severity: Minor
Found in salt/modules/dockermod.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_file_meta has a Cognitive Complexity of 66 (exceeds 5 allowed). Consider refactoring.
Open

def check_file_meta(
        name,
        sfn,
        source,
        source_sum,
Severity: Minor
Found in salt/modules/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 zip_ has a Cognitive Complexity of 66 (exceeds 5 allowed). Consider refactoring.
Open

def zip_(zip_file, sources, template=None, cwd=None, runas=None, zip64=False):
    '''
    Uses the ``zipfile`` Python module to create zip files

    .. versionchanged:: 2015.5.0
Severity: Minor
Found in salt/modules/archive.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 _config_logic has a Cognitive Complexity of 66 (exceeds 5 allowed). Consider refactoring.
Open

def _config_logic(napalm_device,
                  loaded_result,
                  test=False,
                  debug=False,
                  replace=False,
Severity: Minor
Found in salt/modules/napalm_network.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 list_repo_pkgs has a Cognitive Complexity of 66 (exceeds 5 allowed). Consider refactoring.
Open

def list_repo_pkgs(*args, **kwargs):
    '''
    .. versionadded:: 2014.1.0
    .. versionchanged:: 2014.7.0
        All available versions of each package are now returned. This required
Severity: Minor
Found in salt/modules/yumpkg.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 portage_config.py has 600 lines of code (exceeds 250 allowed). Consider refactoring.
Open

# -*- coding: utf-8 -*-
'''
Configure ``portage(5)``
'''

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

    File zabbix_template.py has 599 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    # -*- coding: utf-8 -*-
    '''
    .. versionadded:: 2017.7
    
    Management of Zabbix Template object over Zabbix API.
    Severity: Major
    Found in salt/states/zabbix_template.py - About 1 day to fix

      File x509.py has 599 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      # -*- coding: utf-8 -*-
      '''
      Manage X509 Certificates
      
      .. versionadded:: 2015.8.0
      Severity: Major
      Found in salt/states/x509.py - About 1 day to fix

        File boto_elasticache.py has 596 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        # -*- coding: utf-8 -*-
        '''
        Connection module for Amazon Elasticache
        
        .. versionadded:: 2014.7.0
        Severity: Major
        Found in salt/modules/boto_elasticache.py - About 1 day to fix

          File zonecfg.py has 595 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          # -*- coding: utf-8 -*-
          '''
          Module for Solaris 10's zonecfg
          
          :maintainer:    Jorge Schrauwen <sjorge@blackdot.be>
          Severity: Major
          Found in salt/modules/zonecfg.py - About 1 day to fix

            File cimc.py has 595 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            # -*- coding: utf-8 -*-
            '''
            Module to provide Cisco UCS compatibility to Salt
            
            :codeauthor: ``Spencer Ervin <spencer_ervin@hotmail.com>``
            Severity: Major
            Found in salt/modules/cimc.py - About 1 day to fix

              File parted_partition.py has 594 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              # -*- coding: utf-8 -*-
              '''
              Module for managing partitions on POSIX-like systems.
              
              :depends:   - parted, partprobe, lsblk (usually parted and util-linux packages)
              Severity: Major
              Found in salt/modules/parted_partition.py - About 1 day to fix

                Function groups has a Cognitive Complexity of 65 (exceeds 5 allowed). Consider refactoring.
                Open

                def groups(username, **kwargs):
                    '''
                    Authenticate against an LDAP group
                
                    Behavior is highly dependent on if Active Directory is in use.
                Severity: Minor
                Found in salt/auth/ldap.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 65 (exceeds 5 allowed). Consider refactoring.
                Open

                def present(name,
                            tag=None,
                            build=None,
                            load=None,
                            force=False,
                Severity: Minor
                Found in salt/states/docker_image.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_ssh has a Cognitive Complexity of 65 (exceeds 5 allowed). Consider refactoring.
                Open

                    def handle_ssh(self, mine=False):
                        '''
                        Spin up the needed threads or processes and execute the subsequent
                        routines
                        '''
                Severity: Minor
                Found in salt/client/ssh/__init__.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 meminfo has a Cognitive Complexity of 65 (exceeds 5 allowed). Consider refactoring.
                Open

                def meminfo():
                    '''
                    Return the memory info for this minion
                
                    .. versionchanged:: 2016.11.4
                Severity: Minor
                Found in salt/modules/status.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 load_balancer_create_or_update has a Cognitive Complexity of 65 (exceeds 5 allowed). Consider refactoring.
                Open

                def load_balancer_create_or_update(name, resource_group, **kwargs):
                    '''
                    .. versionadded:: 2019.2.0
                
                    Create or update a load balancer within a specified resource group.
                Severity: Minor
                Found in salt/modules/azurearm_network.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 traceroute has a Cognitive Complexity of 65 (exceeds 5 allowed). Consider refactoring.
                Open

                def traceroute(host):
                    '''
                    Performs a traceroute to a 3rd party host
                
                    .. versionchanged:: 2015.8.0
                Severity: Minor
                Found in salt/modules/network.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