saltstack/salt

View on GitHub

Showing 9,400 of 17,590 total issues

Function __init__ has 45 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    def __init__(self):
        self.audit_lookup = {
            0: 'No auditing',
            1: 'Success',
            2: 'Failure',
Severity: Minor
Found in salt/modules/win_lgpo.py - About 1 hr to fix

    Function make_src_pkg has 44 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    def make_src_pkg(dest_dir, spec, sources, env=None, saltenv='base', runas='root'):
        '''
        Create a platform specific source package from the given platform spec/control file and sources
    
        CLI Example:
    Severity: Minor
    Found in salt/modules/debuild_pkgbuild.py - About 1 hr to fix

      Function handle_message has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
      Open

          def handle_message(self, stream, header, payload):
              '''
              Handle incoming messages from underylying tcp streams
              '''
              try:
      Severity: Minor
      Found in salt/transport/tcp.py - About 1 hr 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 destroy has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
      Open

          def destroy(self):
              if isinstance(self.poller.sockets, dict):
                  sockets = list(self.poller.sockets.keys())
                  for socket in sockets:
                      if socket.closed is False:
      Severity: Minor
      Found in salt/payload.py - About 1 hr 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 calc has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
      Open

      def calc(name, num, oper, minimum=0, maximum=0, ref=None):
          '''
          Perform a calculation on the ``num`` most recent values. Requires a list.
          Valid values for ``oper`` are:
      
      
      Severity: Minor
      Found in salt/thorium/calc.py - About 1 hr 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 _decode_embedded_dict has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
      Open

      def _decode_embedded_dict(src):
          '''
          Convert enbedded bytes to strings if possible.
          Dict helper.
          '''
      Severity: Minor
      Found in salt/transport/frame.py - About 1 hr 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 __verify_minion_publish has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
      Open

          def __verify_minion_publish(self, clear_load):
              '''
              Verify that the passed information authorized a minion to execute
      
              :param dict clear_load: A publication load from a minion
      Severity: Minor
      Found in salt/master.py - About 1 hr 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 _minion_event has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
      Open

          def _minion_event(self, load):
              '''
              Receive an event from the minion and fire it on the master event
              interface
              '''
      Severity: Minor
      Found in salt/daemons/masterapi.py - About 1 hr 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_load has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
      Open

      def get_load(jid):
          '''
          Return the load data that marks a specified jid
          '''
          jid_dir = salt.utils.jid.jid_dir(jid, _job_dir(), __opts__['hash_type'])
      Severity: Minor
      Found in salt/returners/local_cache.py - About 1 hr 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 _query_http has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
      Open

          def _query_http(self, dl_path, repo_info):
              '''
              Download files via http
              '''
              query = None
      Severity: Minor
      Found in salt/spm/__init__.py - About 1 hr 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 _walk_through has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
      Open

      def _walk_through(job_dir):
          '''
          Walk though the jid dir and look for jobs
          '''
          serial = salt.payload.Serial(__opts__)
      Severity: Minor
      Found in salt/returners/local_cache.py - About 1 hr 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 absent has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
      Open

      def absent(name, ip):  # pylint: disable=C0103
          '''
          Ensure that the named host is absent
      
          name
      Severity: Minor
      Found in salt/states/host.py - About 1 hr 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 synchronized has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
      Open

      def synchronized(name, source,
                       delete=False,
                       force=False,
                       update=False,
                       passwordfile=None,
      Severity: Minor
      Found in salt/states/rsync.py - About 1 hr 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 datacenter_configured has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
      Open

      def datacenter_configured(name):
          '''
          Makes sure a datacenter exists.
      
          If the state is run by an ``esxdatacenter`` minion, the name of the
      Severity: Minor
      Found in salt/states/esxdatacenter.py - About 1 hr 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 frozen has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
      Open

      def frozen(name, start=True, path=None):
          '''
          .. versionadded:: 2015.5.0
      
          Ensure that a container is frozen
      Severity: Minor
      Found in salt/states/lxc.py - About 1 hr 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 policy_present has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
      Open

      def policy_present(name, policyName, policyDocument,
                  region=None, key=None, keyid=None, profile=None):
          '''
          Ensure policy exists.
      
      
      Severity: Minor
      Found in salt/states/boto_iot.py - About 1 hr 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 14 (exceeds 5 allowed). Consider refactoring.
      Open

      def present(name, auth=None, **kwargs):
          '''
          Ensure a network exists and is up-to-date
      
          name
      Severity: Minor
      Found in salt/states/neutron_network.py - About 1 hr 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 alias_present has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
      Open

      def alias_present(name, FunctionName, Name, FunctionVersion, Description='',
                        region=None, key=None, keyid=None, profile=None):
          '''
          Ensure alias exists.
      
      
      Severity: Minor
      Found in salt/states/boto_lambda.py - About 1 hr 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 computer_name has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
      Open

      def computer_name(name):
          '''
          Manage the computer's name
      
          name
      Severity: Minor
      Found in salt/states/win_system.py - About 1 hr 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 volume_detached has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
      Open

      def volume_detached(name, server_name=None, provider=None, **kwargs):
          '''
          Check if a block volume is attached.
      
          Returns True if server or Volume do not exist.
      Severity: Minor
      Found in salt/states/cloud.py - About 1 hr 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