saltstack/salt

View on GitHub

Showing 9,400 of 17,590 total issues

Function resolve_capabilities has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
Open

def resolve_capabilities(pkgs, refresh=False, root=None, **kwargs):
    '''
    .. versionadded:: 2018.3.0

    Convert name provides in ``pkgs`` into real package names if
Severity: Minor
Found in salt/modules/zypperpkg.py - About 3 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 fstab has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
Open

def fstab(jail):
    '''
    Display contents of a fstab(5) file defined in specified
    jail's configuration. If no file is defined, return False.

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

def upgrade(refresh=True,
            dryrun=False,
            dist_upgrade=False,
            fromrepo=None,
            novendorchange=False,
Severity: Minor
Found in salt/modules/zypperpkg.py - About 3 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 vcpu_pin has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
Open

def vcpu_pin(vm_, vcpu, cpus):
    '''
    Set which CPUs a VCPU can use.

    CLI Example:
Severity: Minor
Found in salt/modules/xapi_virt.py - About 3 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 hold has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
Open

def hold(name=None, pkgs=None, sources=None, normalize=True, **kwargs):  # pylint: disable=W0613
    '''
    .. versionadded:: 2014.7.0

    Version-lock packages
Severity: Minor
Found in salt/modules/yumpkg.py - About 3 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 create has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
Open

def create(vm_):
    '''
    Create a single VM from a data dict
    '''
    try:
Severity: Minor
Found in salt/cloud/clouds/aliyun.py - About 3 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 render has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
Open

def render(yaml_data, saltenv='base', sls='', argline='', **kws):
    '''
    Accepts YAML as a string or as a file object and runs it through the YAML
    parser.

Severity: Minor
Found in salt/renderers/yaml.py - About 3 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 _run_check_unless has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
Open

    def _run_check_unless(self, low_data, cmd_opts):
        '''
        Check that unless doesn't return 0, and that onlyif returns a 0.
        '''
        ret = {'result': False}
Severity: Minor
Found in salt/state.py - About 3 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 call_highstate has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
Open

    def call_highstate(self, exclude=None, cache=None, cache_name='highstate',
                       force=False, whitelist=None, orchestration_jid=None):
        '''
        Run the sequence to execute the salt highstate for this minion
        '''
Severity: Minor
Found in salt/state.py - About 3 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 collect_local_data has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
Open

    def collect_local_data(self, profile=None, profile_source=None):
        '''
        Collects master system data.
        :return:
        '''
Severity: Minor
Found in salt/cli/support/collector.py - About 3 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 beacon has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
Open

def beacon(config):
    r'''
    Monitor the disk usage of the minion

    Specify thresholds for each disk and only emit a beacon if any of them are
Severity: Minor
Found in salt/beacons/diskusage.py - About 3 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 backends has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
Open

    def backends(self, back=None):
        '''
        Return the backend list
        '''
        if not back:
Severity: Minor
Found in salt/fileserver/__init__.py - About 3 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 envs has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
Open

def envs(ignore_cache=False):
    '''
    Return a list of refs that can be used as environments
    '''
    if not ignore_cache:
Severity: Minor
Found in salt/fileserver/hgfs.py - About 3 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 22 (exceeds 5 allowed). Consider refactoring.
Open

    def find_file(self, path, saltenv, back=None):
        '''
        Find the path and return the fnd structure, this structure is passed
        to other backend interfaces.
        '''
Severity: Minor
Found in salt/fileserver/__init__.py - About 3 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 Sizzle has 77 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function Sizzle( selector, context, results, seed ) {
    var match, elem, m, nodeType,
        // QSA vars
        i, groups, old, nid, newContext, newSelector;

Severity: Major
Found in doc/_themes/saltstack/static/js/vendor/jquery-1.9.1.js - About 3 hrs to fix

    File ipset.py has 295 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    # -*- coding: utf-8 -*-
    '''
    Management of ipsets
    ======================
    
    
    Severity: Minor
    Found in salt/states/ipset.py - About 3 hrs to fix

      File postgres.py has 294 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      # -*- coding: utf-8 -*-
      '''
      Return data to a postgresql server
      
      .. note::
      Severity: Minor
      Found in salt/returners/postgres.py - About 3 hrs to fix

        File boto_cognitoidentity.py has 294 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        # -*- coding: utf-8 -*-
        '''
        Connection module for Amazon CognitoIdentity
        
        .. versionadded:: 2016.11.0
        Severity: Minor
        Found in salt/modules/boto_cognitoidentity.py - About 3 hrs to fix

          File s3.py has 294 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          # -*- coding: utf-8 -*-
          '''
          Copy pillar data from a bucket in Amazon S3
          
          The S3 pillar can be configured in the master config file with the following
          Severity: Minor
          Found in salt/pillar/s3.py - About 3 hrs to fix

            File openvswitch_port.py has 293 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            # -*- coding: utf-8 -*-
            '''
            Management of Open vSwitch ports.
            '''
            
            
            Severity: Minor
            Found in salt/states/openvswitch_port.py - About 3 hrs to fix
              Severity
              Category
              Status
              Source
              Language