saltstack/salt

View on GitHub

Showing 9,400 of 17,590 total issues

Function internalRemoveData has 48 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function internalRemoveData( elem, name, pvt ) {
    if ( !jQuery.acceptData( elem ) ) {
        return;
    }

Severity: Minor
Found in doc/_themes/saltstack/static/js/vendor/jquery-1.9.1.js - About 1 hr to fix

    Function loads has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
    Open

        def loads(self, msg, encoding=None, raw=False):
            '''
            Run the correct loads serialization format
    
            :param encoding: Useful for Python 3 support. If the msgpack data
    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 get_dir has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
    Open

        def get_dir(self, path, dest='', saltenv='base', gzip=None,
                    cachedir=None):
            '''
            Get a directory recursively from the salt-master
            '''
    Severity: Minor
    Found in salt/fileclient.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 runner has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
    Open

        def runner(self, clear_load):
            '''
            Send a master control function back to the runner system
            '''
            # All runner ops pass through eauth
    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 handle_message has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
    Open

        def handle_message(self, stream, payload):
            '''
            Handle incoming messages from underlying TCP streams
    
            :stream ZMQStream stream: A ZeroMQ stream.
    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 _get_master_uri has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
    Open

    def _get_master_uri(master_ip,
                        master_port,
                        source_ip=None,
                        source_port=None):
        '''
    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 __bind has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
    Open

        def __bind(self):
            '''
            Binds the reply server
            '''
            if self.log_queue is not None:
    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 zmq_device has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
    Open

        def zmq_device(self):
            '''
            Multiprocessing target for the zmq queue device
            '''
            self.__setup_signals()
    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 _file_recv has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
    Open

        def _file_recv(self, load):
            '''
            Allows minions to send files to the master, files are sent to the
            master file cache
            '''
    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 wheel has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
    Open

        def wheel(self, clear_load):
            '''
            Send a master control function back to the wheel system
            '''
            # All wheel ops pass through eauth
    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 extract_ipv4 has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
    Open

    def extract_ipv4(roster_order, ipv4):
        '''
        Extract the preferred IP address from the ipv4 grain
        '''
        for ip_type in roster_order:
    Severity: Minor
    Found in salt/roster/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

    Function get_roster_file has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
    Open

    def get_roster_file(options):
        '''
        Find respective roster file.
    
        :param options:
    Severity: Minor
    Found in salt/roster/__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 mk_key has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
    Open

    def mk_key(opts, user):
        if HAS_PWD:
            uid = None
            try:
                uid = pwd.getpwnam(user).pw_uid
    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 _ret_is_not_error has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
    Open

    def _ret_is_not_error(result):
        if result.get('return') and isinstance(result['return'], dict):
            result_dict = result['return']
            is_staterun = all('-' in key for key in result_dict.keys())
            if is_staterun:
    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 _walk has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
    Open

    def _walk(path, value, metrics, timestamp, skip):
        '''
        Recursively include metrics from *value*.
    
        path
    Severity: Minor
    Found in salt/returners/carbon_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 absent has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
    Open

    def absent(name, **kwargs):
        '''
        Ensures that the host group does not exist, eventually delete host group.
    
        .. versionadded:: 2016.3.0
    Severity: Minor
    Found in salt/states/zabbix_hostgroup.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 15 (exceeds 5 allowed). Consider refactoring.
    Open

    def present(name, objectType, user, permission, acetype, propagation):
        '''
        Ensure an ACE is present
        '''
        ret = {'name': name,
    Severity: Minor
    Found in salt/states/win_dacl.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_artifact has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
    Open

    def __get_artifact(salt_source):
        resolved_source = None
        comment = None
        changed = False
    
    
    Severity: Minor
    Found in salt/states/jboss7.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 event_source_mapping_present has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
    Open

    def event_source_mapping_present(name, EventSourceArn, FunctionName,
                                     StartingPosition, Enabled=True, BatchSize=100,
                                     region=None, key=None, keyid=None,
                                     profile=None):
        '''
    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 reloaded has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
    Open

    def reloaded(name, jboss_config, timeout=60, interval=5):
        '''
        Reloads configuration of jboss server.
    
        jboss_config:
    Severity: Minor
    Found in salt/states/jboss7.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