saltstack/salt

View on GitHub

Showing 9,400 of 17,590 total issues

File disk.py has 783 lines of code (exceeds 250 allowed). Consider refactoring.
Open

# -*- coding: utf-8 -*-
'''
Module for managing disks and blockdevices
'''
from __future__ import absolute_import, print_function, unicode_literals
Severity: Major
Found in salt/modules/disk.py - About 1 day to fix

    File service.py has 782 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    # -*- coding: utf-8 -*-
    '''
    Starting or restarting of services and daemons
    ==============================================
    
    
    Severity: Major
    Found in salt/states/service.py - About 1 day to fix

      Function netdev has a Cognitive Complexity of 92 (exceeds 5 allowed). Consider refactoring.
      Open

      def netdev():
          '''
          .. versionchanged:: 2016.3.2
              Return the network device stats for this minion
      
      
      Severity: Minor
      Found in salt/modules/status.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 info has a Cognitive Complexity of 92 (exceeds 5 allowed). Consider refactoring.
      Open

      def info(zone, show_all=False):
          '''
          Display the configuration from memory
      
          zone : string
      Severity: Minor
      Found in salt/modules/zonecfg.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 extract_hash has a Cognitive Complexity of 92 (exceeds 5 allowed). Consider refactoring.
      Open

      def extract_hash(hash_fn,
                       hash_type='sha256',
                       file_name='',
                       source='',
                       source_hash_name=None):
      Severity: Minor
      Found in salt/modules/file.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 replace has a Cognitive Complexity of 92 (exceeds 5 allowed). Consider refactoring.
      Open

      def replace(path,
                  pattern,
                  repl,
                  count=0,
                  flags=8,
      Severity: Minor
      Found in salt/modules/file.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 list_jobs has a Cognitive Complexity of 92 (exceeds 5 allowed). Consider refactoring.
      Open

      def list_jobs(ext_source=None,
                    outputter=None,
                    search_metadata=None,
                    search_function=None,
                    search_target=None,
      Severity: Minor
      Found in salt/runners/jobs.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 key.py has 781 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      # -*- coding: utf-8 -*-
      '''
      The Salt Key backend API and interface used by the CLI. The Key class can be
      used to manage salt keys directly without interfacing with the CLI.
      '''
      Severity: Major
      Found in salt/key.py - About 1 day to fix

        File netscaler.py has 781 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        # -*- coding: utf-8 -*-
        '''
        Module to provide Citrix Netscaler compatibility to Salt (compatible with netscaler 9.2+)
        
        .. versionadded:: 2015.2.0
        Severity: Major
        Found in salt/modules/netscaler.py - About 1 day to fix

          File win_iis.py has 778 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          # -*- coding: utf-8 -*-
          '''
          Microsoft IIS site management
          
          This module provides the ability to add/remove websites and application pools
          Severity: Major
          Found in salt/states/win_iis.py - About 1 day to fix

            File iptables.py has 778 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            # -*- coding: utf-8 -*-
            '''
            Management of iptables
            ======================
            
            
            Severity: Major
            Found in salt/states/iptables.py - About 1 day to fix

              File rabbitmq.py has 775 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              # -*- coding: utf-8 -*-
              '''
              Module to provide RabbitMQ compatibility to Salt.
              Todo: A lot, need to add cluster support, logging, and minion configuration
              data.
              Severity: Major
              Found in salt/modules/rabbitmq.py - About 1 day to fix

                Function repo_present has a Cognitive Complexity of 91 (exceeds 5 allowed). Consider refactoring.
                Open

                def repo_present(
                        name,
                        description=None,
                        homepage=None,
                        private=None,
                Severity: Minor
                Found in salt/states/github.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 present has a Cognitive Complexity of 91 (exceeds 5 allowed). Consider refactoring.
                Open

                def present(name, **kwargs):
                    '''
                    Creates new user group.
                    NOTE: This function accepts all standard user group properties: keyword argument names differ depending on your
                    zabbix version, see:
                Severity: Minor
                Found in salt/states/zabbix_usergroup.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 rr_present has a Cognitive Complexity of 91 (exceeds 5 allowed). Consider refactoring.
                Open

                def rr_present(name, HostedZoneId=None, DomainName=None, PrivateZone=False, Name=None, Type=None,
                               SetIdentifier=None, Weight=None, Region=None, GeoLocation=None, Failover=None,
                               TTL=None, ResourceRecords=None, AliasTarget=None, HealthCheckId=None,
                               TrafficPolicyInstanceId=None,
                               region=None, key=None, keyid=None, profile=None):
                Severity: Minor
                Found in salt/states/boto3_route53.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 options_present has a Cognitive Complexity of 91 (exceeds 5 allowed). Consider refactoring.
                Open

                def options_present(name, sections=None, separator='=', strict=False):
                    '''
                    .. code-block:: yaml
                
                        /home/saltminion/api-paste.ini:
                Severity: Minor
                Found in salt/states/ini_manage.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 _policies_present has a Cognitive Complexity of 91 (exceeds 5 allowed). Consider refactoring.
                Open

                def _policies_present(name, policies, policies_from_pillar, listeners, backends,
                                      region, key, keyid, profile):
                    '''helper method for present. ensure that ELB policies are set'''
                    if policies is None:
                        policies = []
                Severity: Minor
                Found in salt/states/boto_elb.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 check_perms has a Cognitive Complexity of 91 (exceeds 5 allowed). Consider refactoring.
                Open

                def check_perms(obj_name,
                                obj_type='file',
                                ret=None,
                                owner=None,
                                grant_perms=None,
                Severity: Minor
                Found in salt/utils/win_dacl.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 boto_lambda.py has 773 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                # -*- coding: utf-8 -*-
                '''
                Connection module for Amazon Lambda
                
                .. versionadded:: 2016.3.0
                Severity: Major
                Found in salt/modules/boto_lambda.py - About 1 day to fix

                  SaltNeutron has 95 functions (exceeds 20 allowed). Consider refactoring.
                  Open

                  class SaltNeutron(NeutronShell):
                      '''
                      Class for all neutronclient functions
                      '''
                  
                  
                  Severity: Major
                  Found in salt/utils/openstack/neutron.py - About 1 day to fix
                    Severity
                    Category
                    Status
                    Source
                    Language