saltstack/salt

View on GitHub

Showing 9,400 of 17,590 total issues

Function syslog_configured has a Cognitive Complexity of 54 (exceeds 5 allowed). Consider refactoring.
Open

def syslog_configured(name,
                      syslog_configs,
                      firewall=True,
                      reset_service=True,
                      reset_syslog_config=False,
Severity: Minor
Found in salt/states/esxi.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 managed has a Cognitive Complexity of 54 (exceeds 5 allowed). Consider refactoring.
Open

def managed(name, passphrase, entries, force_remove=False):
    '''
    Create or manage a java keystore.

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

def sync(opts,
         form,
         saltenv=None,
         extmod_whitelist=None,
         extmod_blacklist=None):
Severity: Minor
Found in salt/utils/extmods.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 _process_requirements has a Cognitive Complexity of 54 (exceeds 5 allowed). Consider refactoring.
Open

def _process_requirements(requirements, cmd, cwd, saltenv, user):
    '''
    Process the requirements argument
    '''
    cleanup_requirements = []
Severity: Minor
Found in salt/modules/pip.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 add has a Cognitive Complexity of 54 (exceeds 5 allowed). Consider refactoring.
Open

def add(name,
        uid=None,
        gid=None,
        groups=None,
        home=None,
Severity: Minor
Found in salt/modules/useradd.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 _parse_settings_eth has a Cognitive Complexity of 54 (exceeds 5 allowed). Consider refactoring.
Open

def _parse_settings_eth(opts, iface_type, enabled, iface):
    '''
    Filters given options and outputs valid settings for a
    network interface.
    '''
Severity: Minor
Found in salt/modules/debian_ip.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 get_tops has a Cognitive Complexity of 54 (exceeds 5 allowed). Consider refactoring.
Open

    def get_tops(self):
        '''
        Gather the top files
        '''
        tops = DefaultOrderedDict(list)
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

Function ext_pillar has a Cognitive Complexity of 54 (exceeds 5 allowed). Consider refactoring.
Open

def ext_pillar(minion_id,
               pillar,  # pylint: disable=W0613
               use_grain=False,
               minion_ids=None,
               tag_match_key=None,
Severity: Minor
Found in salt/pillar/ec2_pillar.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 update has a Cognitive Complexity of 54 (exceeds 5 allowed). Consider refactoring.
Open

def update():
    '''
    Update caches of the storage containers.

    Compares the md5 of the files on disk to the md5 of the blobs in the
Severity: Minor
Found in salt/fileserver/azurefs.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 container.py has 516 lines of code (exceeds 250 allowed). Consider refactoring.
Open

# -*- coding: utf-8 -*-
'''
Functions to translate input for container creation
'''
# Import Python libs
Severity: Major
Found in salt/utils/docker/translate/container.py - About 1 day to fix

    File version.py has 513 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    # -*- coding: utf-8 -*-
    '''
    Set up the version of Salt
    '''
    
    
    Severity: Major
    Found in salt/version.py - About 1 day to fix

      File highstate_doc.py has 511 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      # -*- coding: utf-8 -*-
      
      # pylint: disable=W1401
      '''
      This module renders highstate configuration into a more human readable format.
      Severity: Major
      Found in salt/modules/highstate_doc.py - About 1 day to fix

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

        def mod_aggregate(low, chunks, running):
            '''
            The mod_aggregate function which looks up all packages in the available
            low chunks and merges them into a single pkgs ref in the present low data
            '''
        Severity: Minor
        Found in salt/states/pkg.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 endpoint_present has a Cognitive Complexity of 53 (exceeds 5 allowed). Consider refactoring.
        Open

        def endpoint_present(name,
                             publicurl=None,
                             internalurl=None,
                             adminurl=None,
                             region=None,
        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 setenv has a Cognitive Complexity of 53 (exceeds 5 allowed). Consider refactoring.
        Open

        def setenv(name,
                   value,
                   false_unsets=False,
                   clear_all=False,
                   update_minion=False,
        Severity: Minor
        Found in salt/states/environ.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 uninstall has a Cognitive Complexity of 53 (exceeds 5 allowed). Consider refactoring.
        Open

            def uninstall(self, updates):
                '''
                Uninstall the updates passed in the updates collection. Load the updates
                collection using the ``search`` or ``available`` functions.
        
        
        Severity: Minor
        Found in salt/utils/win_update.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 _read has a Cognitive Complexity of 53 (exceeds 5 allowed). Consider refactoring.
        Open

            def _read(self, fp, fpname):
                '''
                Makes the following changes from the RawConfigParser:
        
                1. Strip leading tabs from non-section-header lines.
        Severity: Minor
        Found in salt/utils/configparser.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 checkout has a Cognitive Complexity of 53 (exceeds 5 allowed). Consider refactoring.
        Open

            def checkout(self):
                '''
                Checkout the configured branch/tag
                '''
                tgt_ref = self.get_checkout_target()
        Severity: Minor
        Found in salt/utils/gitfs.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 trim_dict has a Cognitive Complexity of 53 (exceeds 5 allowed). Consider refactoring.
        Open

        def trim_dict(
                data,
                max_dict_bytes,
                percent=50.0,
                stepper_size=10,
        Severity: Minor
        Found in salt/utils/dicttrim.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 cloud_init_interface has a Cognitive Complexity of 53 (exceeds 5 allowed). Consider refactoring.
        Open

        def cloud_init_interface(name, vm_=None, **kwargs):
            '''
            Interface between salt.cloud.lxc driver and lxc.init
            ``vm_`` is a mapping of vm opts in the salt.cloud format
            as documented for the lxc driver.
        Severity: Minor
        Found in salt/modules/lxc.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