saltstack/salt

View on GitHub

Showing 9,400 of 17,590 total issues

File win_ip.py has 315 lines of code (exceeds 250 allowed). Consider refactoring.
Open

# -*- coding: utf-8 -*-
'''
The networking module for Windows based systems
'''
from __future__ import absolute_import, unicode_literals, print_function
Severity: Minor
Found in salt/modules/win_ip.py - About 3 hrs to fix

    File solrcloud.py has 315 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    # -*- coding: utf-8 -*-
    '''
    Module for solrcloud configuration
    
    .. versionadded:: 2017.7.0
    Severity: Minor
    Found in salt/modules/solrcloud.py - About 3 hrs to fix

      File ansiblegate.py has 315 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      # -*- coding: utf-8 -*-
      #
      # Author: Bo Maryniuk <bo@suse.de>
      #
      # Copyright 2017 SUSE LLC
      Severity: Minor
      Found in salt/modules/ansiblegate.py - About 3 hrs to fix

        File azurefs.py has 315 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        # -*- coding: utf-8 -*-
        '''
        The backend for serving files from the Azure blob storage service.
        
        .. versionadded:: 2015.8.0
        Severity: Minor
        Found in salt/fileserver/azurefs.py - About 3 hrs to fix

          File win_lgpo.py has 314 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          # -*- coding: utf-8 -*-
          '''
          Manage Windows Local Group Policy
          =================================
          
          
          Severity: Minor
          Found in salt/states/win_lgpo.py - About 3 hrs to fix

            File cache.py has 314 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            # -*- coding: utf-8 -*-
            '''
            In-memory caching used by Salt
            '''
            # Import Python libs
            Severity: Minor
            Found in salt/utils/cache.py - About 3 hrs to fix

              Schedule has 29 functions (exceeds 20 allowed). Consider refactoring.
              Open

              class Schedule(object):
                  '''
                  Create a Schedule object, pass in the opts and the functions dict to use
                  '''
                  instance = None
              Severity: Minor
              Found in salt/utils/schedule.py - About 3 hrs to fix

                File boto_elasticsearch_domain.py has 311 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                # -*- coding: utf-8 -*-
                '''
                Manage Elasticsearch Domains
                ============================
                
                
                Severity: Minor
                Found in salt/states/boto_elasticsearch_domain.py - About 3 hrs to fix

                  File boto_kms.py has 311 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  # -*- coding: utf-8 -*-
                  '''
                  Manage KMS keys, key policies and grants.
                  
                  .. versionadded:: 2015.8.0
                  Severity: Minor
                  Found in salt/states/boto_kms.py - About 3 hrs to fix

                    File lxd_image.py has 311 lines of code (exceeds 250 allowed). Consider refactoring.
                    Open

                    # -*- coding: utf-8 -*-
                    '''
                    Manage LXD images.
                    
                    .. versionadded:: 2019.2.0
                    Severity: Minor
                    Found in salt/states/lxd_image.py - About 3 hrs to fix

                      File win_pdh.py has 311 lines of code (exceeds 250 allowed). Consider refactoring.
                      Open

                      # -*- coding: utf-8 -*-
                      r'''
                      Salt Util for getting system information with the Performance Data Helper (pdh).
                      Counter information is gathered from current activity or log files.
                      
                      
                      Severity: Minor
                      Found in salt/utils/win_pdh.py - About 3 hrs to fix

                        File groupadd.py has 311 lines of code (exceeds 250 allowed). Consider refactoring.
                        Open

                        # -*- coding: utf-8 -*-
                        '''
                        Manage groups on Linux, OpenBSD and NetBSD
                        
                        .. important::
                        Severity: Minor
                        Found in salt/modules/groupadd.py - About 3 hrs to fix

                          Function trigger has 86 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              trigger: function( event, data, elem, onlyHandlers ) {
                                  var handle, ontype, cur,
                                      bubbleType, special, tmp, i,
                                      eventPath = [ elem || document ],
                                      type = core_hasOwn.call( event, "type" ) ? event.type : event,
                          Severity: Major
                          Found in doc/_themes/saltstack/static/js/vendor/jquery-1.9.1.js - About 3 hrs to fix

                            File elasticsearch_return.py has 310 lines of code (exceeds 250 allowed). Consider refactoring.
                            Open

                            # -*- coding: utf-8 -*-
                            '''
                            Return data to an elasticsearch server for indexing.
                            
                            :maintainer:    Jurnell Cockhren <jurnell.cockhren@sophicware.com>, Arnold Bechtoldt <mail@arnoldbechtoldt.com>
                            Severity: Minor
                            Found in salt/returners/elasticsearch_return.py - About 3 hrs to fix

                              Function save_minions has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
                              Open

                              def save_minions(jid, minions, syndic_id=None):  # pylint: disable=unused-argument
                                  '''
                                  Save/update the minion list for a given jid. The syndic_id argument is
                                  included for API compatibility only.
                                  '''
                              Severity: Minor
                              Found in salt/returners/etcd_return.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 install_file has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
                              Open

                              def install_file(package, formula_tar, member, formula_def, conn=None):
                                  '''
                                  Install a single file to the file system
                                  '''
                                  if member.name == package:
                              Severity: Minor
                              Found in salt/spm/pkgfiles/local.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 _build has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
                              Open

                                  def _build(self, args):
                                      '''
                                      Build a package
                                      '''
                                      if len(args) < 2:
                              Severity: Minor
                              Found in salt/spm/__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 present has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
                              Open

                              def present(
                                      name,
                                      policy_document=None,
                                      policy_document_from_pillars=None,
                                      path=None,
                              Severity: Minor
                              Found in salt/states/boto_iam_role.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 append has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
                              Open

                              def append(name, value, convert=False,
                                         delimiter=DEFAULT_TARGET_DELIM):
                                  '''
                                  .. versionadded:: 2014.7.0
                              
                              
                              Severity: Minor
                              Found in salt/states/grains.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 cib_present has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
                              Open

                              def cib_present(name, cibname, scope=None, extra_args=None):
                                  '''
                                  Ensure that a CIB-file with the content of the current live CIB is created
                              
                                  Should be run on one cluster node only
                              Severity: Minor
                              Found in salt/states/pcs.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

                              Severity
                              Category
                              Status
                              Source
                              Language