saltstack/salt

View on GitHub

Showing 9,400 of 17,590 total issues

Function extend has 40 lines of code (exceeds 25 allowed). Consider refactoring.
Open

jQuery.extend = jQuery.fn.extend = function() {
    var src, copyIsArray, copy, name, options, clone,
        target = arguments[0] || {},
        i = 1,
        length = arguments.length,
Severity: Minor
Found in doc/_themes/saltstack/static/js/vendor/jquery-1.9.1.js - About 1 hr to fix

    Function stop has 40 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        stop: function( type, clearQueue, gotoEnd ) {
            var stopQueue = function( hooks ) {
                var stop = hooks.stop;
                delete hooks.stop;
                stop( gotoEnd );
    Severity: Minor
    Found in doc/_themes/saltstack/static/js/vendor/jquery-1.9.1.js - About 1 hr to fix

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

          def __init__(self, attrs=None):
              distutils.dist.Distribution.__init__(self, attrs)
      
              self.ssh_packaging = PACKAGED_FOR_SALT_SSH
              self.salt_transport = None
      Severity: Minor
      Found in setup.py - About 1 hr to fix

        Function on has 40 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            on: function( types, selector, data, fn, /*INTERNAL*/ one ) {
                var type, origFn;
        
                // Types can be a map of types/handlers
                if ( typeof types === "object" ) {
        Severity: Minor
        Found in doc/_themes/saltstack/static/js/vendor/jquery-1.9.1.js - About 1 hr to fix

          Function create has 40 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          def create(vm_):
              '''
              Create a single VM from a data dict
              '''
              try:
          Severity: Minor
          Found in salt/cloud/clouds/digitalocean.py - About 1 hr to fix

            Function handle_key_cache has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
            Open

                def handle_key_cache(self):
                    '''
                    Evaluate accepted keys and create a msgpack file
                    which contains a list
                    '''
            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 mean has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
            Open

            def mean(name, add, match):
                '''
                Accept a numeric value from the matched events and store a running average
                of the values in the given register. If the specified value is not numeric
                it will be skipped
            Severity: Minor
            Found in salt/thorium/reg.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 __init__ has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
            Open

                def __init__(self,
                             opts,
                             **kwargs):
                    self.opts = opts
                    self.ttype = 'zeromq'
            Severity: Minor
            Found in salt/transport/zeromq.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 update_metadata has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
            Open

                def update_metadata(self):
                    for attrname in dir(self):
                        if attrname.startswith('__'):
                            continue
                        attrvalue = getattr(self, attrname, None)
            Severity: Minor
            Found in setup.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 visit_youtube_node has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
            Open

            def visit_youtube_node(self, node):
                aspect = node["aspect"]
                width = node["width"]
                height = node["height"]
            
            
            Severity: Minor
            Found in doc/_ext/youtube.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 run has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
            Open

                def run(self, args):
                    '''
                    Run the SPM command
                    '''
                    command = args[0]
            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 minion_runner has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
            Open

                def minion_runner(self, load):
                    '''
                    Execute a runner from a minion, return the runner's function data
                    '''
                    if 'peer_run' not in self.opts:
            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 _master_tops has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
            Open

                def _master_tops(self, load, skip_verify=False):
                    '''
                    Return the results from master_tops if configured
                    '''
                    if not skip_verify:
            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 cli has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
            Open

                def cli(self, eauth):
                    '''
                    Execute the CLI options to fill in the extra data needed for the
                    defined eauth system
                    '''
            Severity: Minor
            Found in salt/auth/__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 __verify_minion_publish has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
            Open

                def __verify_minion_publish(self, load):
                    '''
                    Verify that the passed information authorized a minion to execute
                    '''
                    # Verify that the load is valid
            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 _connect_sentry has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
            Open

            def _connect_sentry(message, result):
                '''
                Connect to the Sentry server
                '''
                pillar_data = __salt__['pillar.raw']()
            Severity: Minor
            Found in salt/returners/sentry_return.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 match has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
            Open

            def match(tgt, functions=None, opts=None):
                '''
                Match based on the local data store on the minion
                '''
                if not opts:
            Severity: Minor
            Found in salt/matchers/data_match.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 13 (exceeds 5 allowed). Consider refactoring.
            Open

            def absent(name, profile="github", **kwargs):
                '''
                Ensure a github user is absent
            
                .. code-block:: yaml
            Severity: Minor
            Found in salt/states/github.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 returner has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
            Open

            def returner(ret):
                '''
                Take in the return and shove it into the couchdb database.
                '''
            
            
            Severity: Minor
            Found in salt/returners/couchdb_return.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 _set_unicode_string has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
            Open

                def _set_unicode_string(self, name, value):
                    values = []
                    for n in self._string_names_:
                        if n == name:
                            values.append(value or '')
            Severity: Minor
            Found in salt/platform/win.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