saltstack/salt

View on GitHub

Showing 9,400 of 17,590 total issues

File win_network.py has 392 lines of code (exceeds 250 allowed). Consider refactoring.
Open

# -*- coding: utf-8 -*-
'''
Module for gathering and managing network information
'''
from __future__ import absolute_import, unicode_literals, print_function
Severity: Minor
Found in salt/modules/win_network.py - About 5 hrs to fix

    File xfs.py has 390 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    # -*- coding: utf-8 -*-
    #
    # The MIT License (MIT)
    # Copyright (C) 2014 SUSE LLC
    #
    Severity: Minor
    Found in salt/modules/xfs.py - About 5 hrs to fix

      File redis_cache.py has 389 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      # -*- coding: utf-8 -*-
      '''
      Redis
      =====
      
      
      Severity: Minor
      Found in salt/cache/redis_cache.py - About 5 hrs to fix

        State has 40 functions (exceeds 20 allowed). Consider refactoring.
        Open

        class State(object):
            '''
            Class used to execute salt states
            '''
            def __init__(
        Severity: Minor
        Found in salt/state.py - About 5 hrs to fix

          File fluent_mod.py has 388 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          # -*- coding: utf-8 -*-
          '''
              Fluent Logging Handler
              ======================
          
          
          Severity: Minor
          Found in salt/log/handlers/fluent_mod.py - About 5 hrs to fix

            File boto_efs.py has 387 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            # -*- coding: utf-8 -*-
            '''
            Connection module for Amazon EFS
            
            .. versionadded:: 2017.7.0
            Severity: Minor
            Found in salt/modules/boto_efs.py - About 5 hrs to fix

              File boto_elbv2.py has 386 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              # -*- coding: utf-8 -*-
              '''
              Connection module for Amazon ALB
              
              .. versionadded:: 2017.7.0
              Severity: Minor
              Found in salt/modules/boto_elbv2.py - About 5 hrs to fix

                File zookeeper.py has 386 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                # -*- coding: utf-8 -*-
                '''
                Zookeeper Module
                ~~~~~~~~~~~~~~~~
                :maintainer:    SaltStack
                Severity: Minor
                Found in salt/modules/zookeeper.py - About 5 hrs to fix

                  Function publish has a Cognitive Complexity of 35 (exceeds 5 allowed). Consider refactoring.
                  Open

                      def publish(self, load):
                          '''
                          This method sends out publications to the minions, it can only be used
                          by the LocalClient.
                          '''
                  Severity: Minor
                  Found in salt/daemons/masterapi.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 start has a Cognitive Complexity of 35 (exceeds 5 allowed). Consider refactoring.
                  Open

                      def start(self):
                          '''
                          Turn on the master server components
                          '''
                          self._pre_flight()
                  Severity: Minor
                  Found in salt/master.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 private_ips_present has a Cognitive Complexity of 35 (exceeds 5 allowed). Consider refactoring.
                  Open

                  def private_ips_present(name, network_interface_name=None, network_interface_id=None,
                                          private_ip_addresses=None, allow_reassignment=False, region=None, key=None,
                                          keyid=None, profile=None):
                      '''
                      Ensure an ENI has secondary private ip addresses associated with it
                  Severity: Minor
                  Found in salt/states/boto_ec2.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 profile has a Cognitive Complexity of 35 (exceeds 5 allowed). Consider refactoring.
                  Open

                  def profile(name, profile, onlyif=None, unless=None, opts=None, **kwargs):
                      '''
                      Create a single instance on a cloud provider, using a salt-cloud profile.
                  
                      Note that while profiles used this function do take any configuration
                  Severity: Minor
                  Found in salt/states/cloud.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 instance_absent has a Cognitive Complexity of 35 (exceeds 5 allowed). Consider refactoring.
                  Open

                  def instance_absent(name, instance_name=None, instance_id=None,
                                      release_eip=False, region=None, key=None, keyid=None,
                                      profile=None, filters=None):
                      '''
                      Ensure an EC2 instance does not exist (is stopped and removed).
                  Severity: Minor
                  Found in salt/states/boto_ec2.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 _update_entry has a Cognitive Complexity of 35 (exceeds 5 allowed). Consider refactoring.
                  Open

                  def _update_entry(entry, status, directives):
                      '''Update an entry's attributes using the provided directives
                  
                      :param entry:
                          A dict mapping each attribute name to a set of its values
                  Severity: Minor
                  Found in salt/states/ldap.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 35 (exceeds 5 allowed). Consider refactoring.
                  Open

                  def present(name,
                              createdb=None,
                              createroles=None,
                              encrypted=None,
                              superuser=None,
                  Severity: Minor
                  Found in salt/states/postgres_group.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 merge has a Cognitive Complexity of 35 (exceeds 5 allowed). Consider refactoring.
                  Open

                  def merge(value,
                            default='',
                            omit_opts=False,
                            omit_master=False,
                            omit_pillar=False):
                  Severity: Minor
                  Found in salt/client/ssh/wrapper/config.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_data has a Cognitive Complexity of 35 (exceeds 5 allowed). Consider refactoring.
                  Open

                  def mod_data(fsclient):
                      '''
                      Generate the module arguments for the shim data
                      '''
                      # TODO, change out for a fileserver backend
                  Severity: Minor
                  Found in salt/client/ssh/__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 run has a Cognitive Complexity of 35 (exceeds 5 allowed). Consider refactoring.
                  Open

                      def run(self, low):
                          '''
                          Execute a reaction by invoking the proper wrapper func
                          '''
                          self.populate_client_cache(low)
                  Severity: Minor
                  Found in salt/utils/reactor.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 _spawn has a Cognitive Complexity of 35 (exceeds 5 allowed). Consider refactoring.
                  Open

                          def _spawn(self):
                              self.pid, self.child_fd, self.child_fde = self.__fork_ptys()
                  
                              if isinstance(self.args, string_types):
                                  args = [self.args]
                  Severity: Minor
                  Found in salt/utils/vt.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 check_include_exclude has a Cognitive Complexity of 35 (exceeds 5 allowed). Consider refactoring.
                  Open

                  def check_include_exclude(path_str, include_pat=None, exclude_pat=None):
                      '''
                      Check for glob or regexp patterns for include_pat and exclude_pat in the
                      'path_str' string and return True/False conditions as follows.
                        - Default: return 'True' if no include_pat or exclude_pat patterns are
                  Severity: Minor
                  Found in salt/utils/stringutils.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