saltstack/salt

View on GitHub

Showing 9,400 of 17,590 total issues

File query.py has 396 lines of code (exceeds 250 allowed). Consider refactoring.
Open

# -*- coding: utf-8 -*-
#
# Copyright 2015 SUSE LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
Severity: Minor
Found in salt/modules/inspectlib/query.py - About 5 hrs to fix

    File stateconf.py has 396 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    # -*- coding: utf-8 -*-
    '''
    A flexible renderer that takes a templating engine and a data format
    
    :maintainer: Jack Kuan <kjkuan@gmail.com>
    Severity: Minor
    Found in salt/renderers/stateconf.py - About 5 hrs to fix

      File grains.py has 395 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      # -*- coding: utf-8 -*-
      '''
      Manage grains on the minion
      ===========================
      
      
      Severity: Minor
      Found in salt/states/grains.py - About 5 hrs to fix

        File freebsdports.py has 395 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        # -*- coding: utf-8 -*-
        '''
        Install software from the FreeBSD ``ports(7)`` system
        
        .. versionadded:: 2014.1.0
        Severity: Minor
        Found in salt/modules/freebsdports.py - About 5 hrs to fix

          Function enumerate_tokens has a Cognitive Complexity of 36 (exceeds 5 allowed). Consider refactoring.
          Open

          def enumerate_tokens(sid=None, session_id=None, privs=None):
              '''
              Enumerate tokens from any existing processes that can be accessed.
              Optionally filter by sid.
              '''
          Severity: Minor
          Found in salt/platform/win.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 upgraded has a Cognitive Complexity of 36 (exceeds 5 allowed). Consider refactoring.
          Open

          def upgraded(name,
                       version=None,
                       source=None,
                       force=False,
                       pre_versions=False,
          Severity: Minor
          Found in salt/states/chocolatey.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 _object_reducer has a Cognitive Complexity of 36 (exceeds 5 allowed). Consider refactoring.
          Open

          def _object_reducer(o, names=('id', 'name', 'path', 'httpMethod',
                                        'statusCode', 'Created', 'Deleted',
                                        'Updated', 'Flushed', 'Associated', 'Disassociated')):
              '''
              Helper function to reduce the amount of information that will be kept in the change log
          Severity: Minor
          Found in salt/states/boto_apigateway.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 process_saltfile has a Cognitive Complexity of 36 (exceeds 5 allowed). Consider refactoring.
          Open

              def process_saltfile(self):
                  if self.options.saltfile is None:
                      # No one passed a Saltfile as an option, environment variable!?
                      self.options.saltfile = os.environ.get('SALT_SALTFILE', None)
          
          
          Severity: Minor
          Found in salt/utils/parsers.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_bootstrap has a Cognitive Complexity of 36 (exceeds 5 allowed). Consider refactoring.
          Open

          def update_bootstrap(config, url=None):
              '''
              Update the salt-bootstrap script
          
              url can be one of:
          Severity: Minor
          Found in salt/utils/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 _command has a Cognitive Complexity of 36 (exceeds 5 allowed). Consider refactoring.
          Open

          def _command(source, command, flags=None, opts=None,
                       property_name=None, property_value=None,
                       filesystem_properties=None, pool_properties=None,
                       target=None):
              '''
          Severity: Minor
          Found in salt/utils/zfs.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 __init__ has a Cognitive Complexity of 36 (exceeds 5 allowed). Consider refactoring.
          Open

              def __init__(self,
                           args=None,
                           executable=None,
                           shell=False,
                           cwd=None,
          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 store_job has a Cognitive Complexity of 36 (exceeds 5 allowed). Consider refactoring.
          Open

          def store_job(opts, load, event=None, mminion=None):
              '''
              Store job information using the configured master_job_cache
              '''
              # Generate EndTime
          Severity: Minor
          Found in salt/utils/job.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 remove has a Cognitive Complexity of 36 (exceeds 5 allowed). Consider refactoring.
          Open

          def remove(module, details=False):
              '''
              Attempt to remove a Perl module that was installed from CPAN. Because the
              ``cpan`` command doesn't actually support 'uninstall'-like functionality,
              this function will attempt to do what it can, with what it has from CPAN.
          Severity: Minor
          Found in salt/modules/cpan.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 has a Cognitive Complexity of 36 (exceeds 5 allowed). Consider refactoring.
          Open

          def update(name,
                     password=None,
                     fullname=None,
                     description=None,
                     home=None,
          Severity: Minor
          Found in salt/modules/win_useradd.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 latest_version has a Cognitive Complexity of 36 (exceeds 5 allowed). Consider refactoring.
          Open

          def latest_version(*names, **kwargs):
              '''
              Return the latest version of the named package available for upgrade or
              installation. If more than one package name is specified, a dict of
              name/version pairs is returned.
          Severity: Minor
          Found in salt/modules/yumpkg.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 cert has a Cognitive Complexity of 36 (exceeds 5 allowed). Consider refactoring.
          Open

          def cert(name,
                   aliases=None,
                   email=None,
                   webroot=None,
                   test_cert=False,
          Severity: Minor
          Found in salt/modules/acme.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 create has a Cognitive Complexity of 36 (exceeds 5 allowed). Consider refactoring.
          Open

          def create(vm_):
              r'''
              Create a single VM from a data dict.
          
              vm\_
          Severity: Minor
          Found in salt/cloud/clouds/opennebula.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 add_implicit_requires has a Cognitive Complexity of 36 (exceeds 5 allowed). Consider refactoring.
          Open

          def add_implicit_requires(data):
          
              def T(sid, state):  # pylint: disable=C0103
                  return '{0}:{1}'.format(sid, state_name(state))
          
          
          Severity: Minor
          Found in salt/renderers/stateconf.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 apply_vm_profiles_config has a Cognitive Complexity of 36 (exceeds 5 allowed). Consider refactoring.
          Open

          def apply_vm_profiles_config(providers, overrides, defaults=None):
              if defaults is None:
                  defaults = VM_CONFIG_DEFAULTS
          
              config = defaults.copy()
          Severity: Minor
          Found in salt/config/__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 beacon has a Cognitive Complexity of 36 (exceeds 5 allowed). Consider refactoring.
          Open

          def beacon(config):
              '''
              Emit the load averages of this host.
          
              Specify thresholds for each load average
          Severity: Minor
          Found in salt/beacons/load.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