saltstack/salt

View on GitHub

Showing 9,400 of 17,590 total issues

File saltify.py has 381 lines of code (exceeds 250 allowed). Consider refactoring.
Open

# -*- coding: utf-8 -*-
'''
.. _saltify-module:

Saltify Module
Severity: Minor
Found in salt/cloud/clouds/saltify.py - About 5 hrs to fix

    File purefb.py has 380 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    # -*- coding: utf-8 -*-
    
    ##
    # Copyright 2018 Pure Storage Inc
    #
    Severity: Minor
    Found in salt/modules/purefb.py - About 5 hrs to fix

      File shadow.py has 379 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      # -*- coding: utf-8 -*-
      '''
      Manage the shadow file on Linux systems
      
      .. important::
      Severity: Minor
      Found in salt/modules/shadow.py - About 5 hrs to fix

        File pw_user.py has 379 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

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

          File smartos_imgadm.py has 379 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          # -*- coding: utf-8 -*-
          '''
          Module for running imgadm command on SmartOS
          '''
          from __future__ import absolute_import, unicode_literals, print_function
          Severity: Minor
          Found in salt/modules/smartos_imgadm.py - About 5 hrs to fix

            Function system_information has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring.
            Open

            def system_information():
                '''
                Report system versions.
                '''
                def system_version():
            Severity: Minor
            Found in salt/version.py - About 5 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 replication_group_present has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring.
            Open

            def replication_group_present(name, wait=900, security_groups=None, region=None, key=None,
                                          keyid=None, profile=None, **args):
                '''
                Ensure a replication group exists and is in the given state.
            
            
            Severity: Minor
            Found in salt/states/boto3_elasticache.py - About 5 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 cache_parameter_group_present has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring.
            Open

            def cache_parameter_group_present(name, region=None, key=None, keyid=None, profile=None, **args):
                '''
                Ensure cache parameter group exists.
            
                name
            Severity: Minor
            Found in salt/states/boto3_elasticache.py - About 5 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 present has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring.
            Open

            def present(name, deployment_id, metric_name, alert_config, api_key=None, profile='telemetry'):
                '''
                Ensure the telemetry alert exists.
            
                name
            Severity: Minor
            Found in salt/states/telemetry_alert.py - About 5 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_filters has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring.
            Open

            def _get_filters(kwargs):
                role_kwargs = {'name': kwargs.pop('role')}
                if 'role_domain' in kwargs:
                    domain = __salt__['keystoneng.get_entity'](
                                      'domain', name=kwargs.pop('role_domain'))
            Severity: Minor
            Found in salt/states/keystone_role_grant.py - About 5 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 mod_aggregate has a Cognitive Complexity of 34 (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/pip_state.py - About 5 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 generate_ticket has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring.
            Open

            def generate_ticket(name, output=None, grain=None, key=None, overwrite=True):
                '''
                Generate an icinga2 ticket on the master.
            
                name
            Severity: Minor
            Found in salt/states/icinga2.py - About 5 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 portgroups_configured has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring.
            Open

            def portgroups_configured(name, dvs, portgroups):
                '''
                Configures portgroups on a DVS.
            
                Creates/updates/removes portgroups in a provided DVS
            Severity: Minor
            Found in salt/states/dvs.py - About 5 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_cli_event_returns has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring.
            Open

                def get_cli_event_returns(
                        self,
                        jid,
                        minions,
                        timeout=None,
            Severity: Minor
            Found in salt/client/__init__.py - About 5 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 name_match has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring.
            Open

                def name_match(self, match, full=False):
                    '''
                    Accept a glob which to match the of a key and return the key's location
                    '''
                    if full:
            Severity: Minor
            Found in salt/key.py - About 5 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 _netbsd_interfaces_ifconfig has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring.
            Open

            def _netbsd_interfaces_ifconfig(out):
                '''
                Uses ifconfig to return a dictionary of interfaces with various information
                about each (up/down state, ip address, netmask, and hwaddr)
                '''
            Severity: Minor
            Found in salt/utils/network.py - About 5 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_event has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring.
            Open

                def _get_event(self, wait, tag, match_func=None, no_block=False):
                    if match_func is None:
                        match_func = self._get_match_func()
                    start = time.time()
                    timeout_at = start + wait
            Severity: Minor
            Found in salt/utils/event.py - About 5 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 services has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring.
            Open

            def services(services_file='/etc/services'):
                '''
                Parse through system-known services
                :return: {
                    'svc': [
            Severity: Minor
            Found in salt/utils/dns.py - About 5 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 changed has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring.
            Open

                def changed(self):
                    '''
                    Returns all keys that have been changed.
            
                    If the keys are in child dictionaries they will be represented with
            Severity: Minor
            Found in salt/utils/dictdiffer.py - About 5 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 add_conf_overlay has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring.
            Open

                def add_conf_overlay(cls, name):
                    '''
                    Programmatically determine config value based on the desired saltenv
                    '''
                    def _getconf(self, tgt_env='base'):
            Severity: Minor
            Found in salt/utils/gitfs.py - About 5 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