saltstack/salt

View on GitHub

Showing 9,400 of 17,590 total issues

Function persist has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring.
Open

def persist(name, value, config=None):
    '''
    Assign and persist a simple sysctl parameter for this minion. If ``config``
    is not specified, a sensible default will be chosen using
    :mod:`sysctl.default_config <salt.modules.linux_sysctl.default_config>`.
Severity: Minor
Found in salt/modules/linux_sysctl.py - About 4 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 get has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring.
Open

def get(tgt,
        fun,
        tgt_type='glob',
        exclude_minion=False):
    '''
Severity: Minor
Found in salt/modules/mine.py - About 4 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 modified has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring.
Open

def modified(*packages, **flags):
    '''
    List the modified files that belong to a package. Not specifying any packages
    will return a list of _all_ modified files on the system's RPM database.

Severity: Minor
Found in salt/modules/rpm_lowpkg.py - About 4 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 modify has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring.
Open

def modify(name, beacon_data, **kwargs):
    '''
    Modify an existing beacon.

    Args:
Severity: Minor
Found in salt/modules/beacons.py - About 4 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 _disk_profile has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring.
Open

def _disk_profile(profile, hypervisor, disks=None, vm_name=None, image=None, pool=None, **kwargs):
    '''
    Gather the disk profile from the config or apply the default based
    on the active hypervisor

Severity: Minor
Found in salt/modules/virt.py - About 4 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 update_vm has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring.
Open

def update_vm(vm_name, cpu=None, memory=None, image=None, version=None,
              interfaces=None, disks=None, scsi_devices=None,
              serial_ports=None, datacenter=None, datastore=None,
              cd_dvd_drives=None, sata_controllers=None, advanced_configs=None,
              service_instance=None):
Severity: Minor
Found in salt/modules/vsphere.py - About 4 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 set_tags has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring.
Open

def set_tags(name=None,
             tags=None,
             call=None,
             location=None,
             instance_id=None,
Severity: Minor
Found in salt/cloud/clouds/ec2.py - About 4 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 find has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring.
Open

def find(addr, best=True, display=_DEFAULT_DISPLAY):
    '''
    Search in all possible entities (Interfaces, MAC tables, ARP tables, LLDP neighbors),
    using the following mine functions:

Severity: Minor
Found in salt/runners/net.py - About 4 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 post_master_init has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring.
Open

def post_master_init(self, master):

    log.debug("subclassed LazyLoaded _post_master_init")
    if self.connected:
        self.opts['master'] = master
Severity: Minor
Found in salt/metaproxy/proxy.py - About 4 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 validate has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring.
Open

def validate(config):
    '''
    Validate the beacon configuration
    '''

Severity: Minor
Found in salt/beacons/load.py - About 4 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 decrypt_aes has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring.
Open

    def decrypt_aes(self, payload, master_pub=True):
        '''
        This function is used to decrypt the AES seed phrase returned from
        the master server. The seed phrase is decrypted with the SSH RSA
        host key.
Severity: Minor
Found in salt/crypt.py - About 4 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 find_file has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring.
Open

def find_file(path, tgt_env='base', **kwargs):  # pylint: disable=W0613
    '''
    Find the first file to match the path and ref, read the file out of hg
    and send the path to the newly cached file
    '''
Severity: Minor
Found in salt/fileserver/hgfs.py - About 4 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 file_list has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring.
Open

def file_list(load):
    '''
    Return a list of all files on the file server in a specified environment
    '''
    if 'env' in load:
Severity: Minor
Found in salt/fileserver/minionfs.py - About 4 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

File freebsdservice.py has 357 lines of code (exceeds 250 allowed). Consider refactoring.
Open

# -*- coding: utf-8 -*-
'''
The service module for FreeBSD

.. important::
Severity: Minor
Found in salt/modules/freebsdservice.py - About 4 hrs to fix

    File bridge.py has 356 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    # -*- coding: utf-8 -*-
    '''
    Module for gathering and managing bridging information
    '''
    from __future__ import absolute_import, print_function, unicode_literals
    Severity: Minor
    Found in salt/modules/bridge.py - About 4 hrs to fix

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

      # -*- coding: utf-8 -*-
      '''
      A state module to manage Cisco UCS chassis devices.
      
      :codeauthor: ``Spencer Ervin <spencer_ervin@hotmail.com>``
      Severity: Minor
      Found in salt/states/cimc.py - About 4 hrs to fix

        File cache.py has 355 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        # -*- coding: utf-8 -*-
        '''
        Return cached data from minions
        '''
        from __future__ import absolute_import, print_function, unicode_literals
        Severity: Minor
        Found in salt/runners/cache.py - About 4 hrs to fix

          File azurearm_dns.py has 354 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          # -*- coding: utf-8 -*-
          '''
          Azure (ARM) DNS Execution Module
          
          .. versionadded:: Fluorine
          Severity: Minor
          Found in salt/modules/azurearm_dns.py - About 4 hrs to fix

            File solaris_user.py has 352 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            # -*- coding: utf-8 -*-
            '''
            Manage users with the useradd command
            
            .. important::
            Severity: Minor
            Found in salt/modules/solaris_user.py - About 4 hrs to fix

              File cli.py has 352 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              # -*- coding: utf-8 -*-
              '''
              Primary interfaces for the salt-cloud system
              '''
              # Need to get data from 4 sources!
              Severity: Minor
              Found in salt/cloud/cli.py - About 4 hrs to fix
                Severity
                Category
                Status
                Source
                Language