saltstack/salt

View on GitHub

Showing 9,400 of 17,590 total issues

Function present has a Cognitive Complexity of 50 (exceeds 5 allowed). Consider refactoring.
Open

def present(name,
            source,
            aliases=None,
            public=None,
            auto_update=None,
Severity: Minor
Found in salt/states/lxd_image.py - About 7 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 deploy_windows has a Cognitive Complexity of 50 (exceeds 5 allowed). Consider refactoring.
Open

def deploy_windows(host,
                   port=445,
                   timeout=900,
                   username='Administrator',
                   password=None,
Severity: Minor
Found in salt/utils/cloud.py - About 7 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 50 (exceeds 5 allowed). Consider refactoring.
Open

def create(name,
           config=None,
           profile=None,
           network_profile=None,
           nic_opts=None,
Severity: Minor
Found in salt/modules/lxc.py - About 7 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 check_ace has a Cognitive Complexity of 50 (exceeds 5 allowed). Consider refactoring.
Open

def check_ace(path, objectType, user, permission=None, acetype=None, propagation=None, exactPermissionMatch=False):
    '''
    Checks a path to verify the ACE (access control entry) specified exists

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

def verify(*packages, **kwargs):
    '''
    Runs an rpm -Va on a system, and returns the results in a dict

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

def init(name,
         cpu,
         mem,
         image=None,
         nic='default',
Severity: Minor
Found in salt/modules/virt.py - About 7 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 _return_pub_multi has a Cognitive Complexity of 50 (exceeds 5 allowed). Consider refactoring.
Open

    def _return_pub_multi(self, rets, ret_cmd='_return', timeout=60, sync=True):
        '''
        Return the data from the executed command to the master server
        '''
        if not isinstance(rets, list):
Severity: Minor
Found in salt/minion.py - About 7 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 pillar.py has 489 lines of code (exceeds 250 allowed). Consider refactoring.
Open

# -*- coding: utf-8 -*-
'''
Extract the pillar data for this minion
'''
from __future__ import absolute_import, print_function, unicode_literals
Severity: Minor
Found in salt/modules/pillar.py - About 7 hrs to fix

    Minion has 54 functions (exceeds 20 allowed). Consider refactoring.
    Open

    class Minion(MinionBase):
        '''
        This class instantiates a minion, runs connections for a minion,
        and loads all of the functions into the minion
        '''
    Severity: Major
    Found in salt/minion.py - About 7 hrs to fix

      File redismod.py has 486 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      # -*- coding: utf-8 -*-
      '''
      Module to provide redis functionality to Salt
      
      .. versionadded:: 2014.7.0
      Severity: Minor
      Found in salt/modules/redismod.py - About 7 hrs to fix

        File dimensiondata.py has 485 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        # -*- coding: utf-8 -*-
        '''
        Dimension Data Cloud Module
        ===========================
        
        
        Severity: Minor
        Found in salt/cloud/clouds/dimensiondata.py - About 7 hrs to fix

          File openvswitch.py has 484 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          # -*- coding: utf-8 -*-
          '''
          Support for Open vSwitch - module with basic Open vSwitch commands.
          
          Suitable for setting up Openstack Neutron.
          Severity: Minor
          Found in salt/modules/openvswitch.py - About 7 hrs to fix

            File arista_pyeapi.py has 484 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            # -*- coding: utf-8 -*-
            '''
            Arista pyeapi
            =============
            
            
            Severity: Minor
            Found in salt/modules/arista_pyeapi.py - About 7 hrs to fix

              File influxdbmod.py has 483 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              # -*- coding: utf-8 -*-
              '''
              InfluxDB - A distributed time series database
              
              Module to provide InfluxDB compatibility to Salt (compatible with InfluxDB
              Severity: Minor
              Found in salt/modules/influxdbmod.py - About 7 hrs to fix

                Function distribution_present has a Cognitive Complexity of 49 (exceeds 5 allowed). Consider refactoring.
                Open

                def distribution_present(name, region=None, key=None, keyid=None, profile=None, **kwargs):
                    '''
                    Ensure the given CloudFront distribution exists in the described state.
                
                    The implementation of this function, and all those following, is orthagonal
                Severity: Minor
                Found in salt/states/boto_cloudfront.py - About 7 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 dashboard_present has a Cognitive Complexity of 49 (exceeds 5 allowed). Consider refactoring.
                Open

                def dashboard_present(
                        name,
                        dashboard=None,
                        dashboard_from_pillar=None,
                        rows=None,
                Severity: Minor
                Found in salt/states/grafana.py - About 7 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 cached has a Cognitive Complexity of 49 (exceeds 5 allowed). Consider refactoring.
                Open

                def cached(name,
                           source_hash='',
                           source_hash_name=None,
                           skip_verify=False,
                           saltenv='base'):
                Severity: Minor
                Found in salt/states/file.py - About 7 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 has a Cognitive Complexity of 49 (exceeds 5 allowed). Consider refactoring.
                Open

                def run(name,
                        image=None,
                        onlyif=None,
                        unless=None,
                        creates=None,
                Severity: Minor
                Found in salt/states/docker_container.py - About 7 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 _rules_present has a Cognitive Complexity of 49 (exceeds 5 allowed). Consider refactoring.
                Open

                def _rules_present(name, rules, delete_ingress_rules=True, vpc_id=None,
                                   vpc_name=None, region=None, key=None, keyid=None, profile=None):
                    '''
                    given a group name or group name and vpc_id (or vpc name):
                    1. get lists of desired rule changes (using _get_rule_changes)
                Severity: Minor
                Found in salt/states/boto_secgroup.py - About 7 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 _rules_egress_present has a Cognitive Complexity of 49 (exceeds 5 allowed). Consider refactoring.
                Open

                def _rules_egress_present(name, rules_egress, delete_egress_rules=True, vpc_id=None,
                                          vpc_name=None, region=None, key=None, keyid=None, profile=None):
                    '''
                    given a group name or group name and vpc_id (or vpc name):
                    1. get lists of desired rule changes (using _get_rule_changes)
                Severity: Minor
                Found in salt/states/boto_secgroup.py - About 7 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

                Severity
                Category
                Status
                Source
                Language