saltstack/salt

View on GitHub

Showing 9,400 of 17,590 total issues

Function render has a Cognitive Complexity of 60 (exceeds 5 allowed). Consider refactoring.
Open

def render(input, saltenv='base', sls='', argline='', **kws):
    gen_start_state = False
    no_goal_state = False
    implicit_require = False

Severity: Minor
Found in salt/renderers/stateconf.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 format_log has a Cognitive Complexity of 60 (exceeds 5 allowed). Consider refactoring.
Open

def format_log(ret):
    '''
    Format the state into a log message
    '''
    msg = ''
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 beacon has a Cognitive Complexity of 60 (exceeds 5 allowed). Consider refactoring.
Open

def beacon(config):
    '''
    Read the last btmp file and return information on the failed logins
    '''
    ret = []
Severity: Minor
Found in salt/beacons/btmp.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 ipc.py has 558 lines of code (exceeds 250 allowed). Consider refactoring.
Open

# -*- coding: utf-8 -*-
'''
IPC transport classes
'''

Severity: Major
Found in salt/transport/ipc.py - About 1 day to fix

    File azurearm_dns.py has 554 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    # -*- coding: utf-8 -*-
    '''
    Azure (ARM) DNS State Module
    
    .. versionadded:: Fluorine
    Severity: Major
    Found in salt/states/azurearm_dns.py - About 1 day to fix

      Function _dataset_present has a Cognitive Complexity of 59 (exceeds 5 allowed). Consider refactoring.
      Open

      def _dataset_present(dataset_type, name, volume_size=None, sparse=False, create_parent=False, properties=None, cloned_from=None):
          '''
          internal handler for filesystem_present/volume_present
      
          dataset_type : string
      Severity: Minor
      Found in salt/states/zfs.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 scheduled_snapshot has a Cognitive Complexity of 59 (exceeds 5 allowed). Consider refactoring.
      Open

      def scheduled_snapshot(name, prefix, recursive=True, schedule=None):
          '''
          maintain a set of snapshots based on a schedule
      
          name : string
      Severity: Minor
      Found in salt/states/zfs.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 run_wfunc has a Cognitive Complexity of 59 (exceeds 5 allowed). Consider refactoring.
      Open

          def run_wfunc(self):
              '''
              Execute a wrapper function
      
              Returns tuple of (json_data, '')
      Severity: Minor
      Found in salt/client/ssh/__init__.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 cmd_block has a Cognitive Complexity of 59 (exceeds 5 allowed). Consider refactoring.
      Open

          def cmd_block(self, is_retry=False):
              '''
              Prepare the pre-check command to send to the subsystem
      
              1. execute SHIM + command
      Severity: Minor
      Found in salt/client/ssh/__init__.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 _network_conf has a Cognitive Complexity of 59 (exceeds 5 allowed). Consider refactoring.
      Open

      def _network_conf(conf_tuples=None, **kwargs):
          '''
          Network configuration defaults
      
              network_profile
      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

      Function install has a Cognitive Complexity of 59 (exceeds 5 allowed). Consider refactoring.
      Open

      def install(name=None,
                  refresh=False,
                  pkgs=None,
                  sources=None,
                  reinstall=False,
      Severity: Minor
      Found in salt/modules/opkg.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 set_known_host has a Cognitive Complexity of 59 (exceeds 5 allowed). Consider refactoring.
      Open

      def set_known_host(user=None,
                         hostname=None,
                         fingerprint=None,
                         key=None,
                         port=None,
      Severity: Minor
      Found in salt/modules/ssh.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 s3fs.py has 552 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      # -*- coding: utf-8 -*-
      '''
      Amazon S3 Fileserver Backend
      
      .. versionadded:: 0.16.0
      Severity: Major
      Found in salt/fileserver/s3fs.py - About 1 day to fix

        File boto_s3_bucket.py has 551 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        # -*- coding: utf-8 -*-
        '''
        Manage S3 Buckets
        =================
        
        
        Severity: Major
        Found in salt/states/boto_s3_bucket.py - About 1 day to fix

          File __init__.py has 551 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          # -*- coding: utf-8 -*-
          '''
          Helpful decorators for module writing
          '''
          
          
          Severity: Major
          Found in salt/utils/decorators/__init__.py - About 1 day to fix

            File libvirt_events.py has 551 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            # -*- coding: utf-8 -*-
            
            '''
            An engine that listens for libvirt events and resends them to the salt event bus.
            
            
            Severity: Major
            Found in salt/engines/libvirt_events.py - About 1 day to fix

              Function setDocument has 230 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              setDocument = Sizzle.setDocument = function( node ) {
                  var doc = node ? node.ownerDocument || node : preferredDoc;
              
                  // If no document and documentElement is available, return
                  if ( doc === document || doc.nodeType !== 9 || !doc.documentElement ) {
              Severity: Major
              Found in doc/_themes/saltstack/static/js/vendor/jquery-1.9.1.js - About 1 day to fix

                File glassfish.py has 550 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                # -*- coding: utf-8 -*-
                '''
                Manage Glassfish/Payara server
                .. versionadded:: Carbon
                
                
                Severity: Major
                Found in salt/states/glassfish.py - About 1 day to fix

                  File tomcat.py has 549 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  # -*- coding: utf-8 -*-
                  '''
                  Support for Tomcat
                  
                  This module uses the manager webapp to manage Apache tomcat webapps.
                  Severity: Major
                  Found in salt/modules/tomcat.py - About 1 day to fix

                    File k8s.py has 546 lines of code (exceeds 250 allowed). Consider refactoring.
                    Open

                    # -*- coding: utf-8 -*-
                    '''
                    Salt module to manage Kubernetes cluster
                    
                    .. versionadded:: 2016.3.0
                    Severity: Major
                    Found in salt/modules/k8s.py - About 1 day to fix
                      Severity
                      Category
                      Status
                      Source
                      Language