saltstack/salt

View on GitHub
salt/modules/zabbix.py

Summary

Maintainability
F
1 mo
Test Coverage

File zabbix.py has 2118 lines of code (exceeds 250 allowed). Consider refactoring.
Open

# -*- coding: utf-8 -*-
'''
Support for Zabbix

:optdepends:    - zabbix server
Severity: Major
Found in salt/modules/zabbix.py - About 5 days to fix

    Function compare_params has a Cognitive Complexity of 67 (exceeds 5 allowed). Consider refactoring.
    Open

    def compare_params(defined, existing, return_old_value=False):
        '''
        .. versionadded:: 2017.7
    
        Compares Zabbix object definition against existing Zabbix object.
    Severity: Minor
    Found in salt/modules/zabbix.py - About 1 day 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 host_exists has a Cognitive Complexity of 38 (exceeds 5 allowed). Consider refactoring.
    Open

    def host_exists(host=None, hostid=None, name=None, node=None, nodeids=None, **kwargs):
        '''
        Checks if at least one host that matches the given filter criteria exists.
    
        .. versionadded:: 2016.3.0
    Severity: Minor
    Found in salt/modules/zabbix.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 hostgroup_exists has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring.
    Open

    def hostgroup_exists(name=None, groupid=None, node=None, nodeids=None, **kwargs):
        '''
        Checks if at least one host group that matches the given filter criteria exists.
    
        .. versionadded:: 2016.3.0
    Severity: Minor
    Found in salt/modules/zabbix.py - About 4 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 usergroup_exists has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
    Open

    def usergroup_exists(name=None, node=None, nodeids=None, **kwargs):
        '''
        Checks if at least one user group that matches the given filter criteria exists
    
        .. versionadded:: 2016.3.0
    Severity: Minor
    Found in salt/modules/zabbix.py - About 3 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

    Cyclomatic complexity is too high in function compare_params. (31)
    Open

    def compare_params(defined, existing, return_old_value=False):
        '''
        .. versionadded:: 2017.7
    
        Compares Zabbix object definition against existing Zabbix object.
    Severity: Minor
    Found in salt/modules/zabbix.py by radon

    Cyclomatic Complexity

    Cyclomatic Complexity corresponds to the number of decisions a block of code contains plus 1. This number (also called McCabe number) is equal to the number of linearly independent paths through the code. This number can be used as a guide when testing conditional logic in blocks.

    Radon analyzes the AST tree of a Python program to compute Cyclomatic Complexity. Statements have the following effects on Cyclomatic Complexity:

    Construct Effect on CC Reasoning
    if +1 An if statement is a single decision.
    elif +1 The elif statement adds another decision.
    else +0 The else statement does not cause a new decision. The decision is at the if.
    for +1 There is a decision at the start of the loop.
    while +1 There is a decision at the while statement.
    except +1 Each except branch adds a new conditional path of execution.
    finally +0 The finally block is unconditionally executed.
    with +1 The with statement roughly corresponds to a try/except block (see PEP 343 for details).
    assert +1 The assert statement internally roughly equals a conditional statement.
    Comprehension +1 A list/set/dict comprehension of generator expression is equivalent to a for loop.
    Boolean Operator +1 Every boolean operator (and, or) adds a decision point.

    Source: http://radon.readthedocs.org/en/latest/intro.html

    Function usermacro_get has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
    Open

    def usermacro_get(macro=None, hostids=None, templateids=None, hostmacroids=None,
                      globalmacroids=None, globalmacro=False, **kwargs):
        '''
        Retrieve user macros according to the given parameters.
    
    
    Severity: Minor
    Found in salt/modules/zabbix.py - About 2 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 _login has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
    Open

    def _login(**kwargs):
        '''
        Log in to the API and generate the authentication token.
    
        .. versionadded:: 2016.3.0
    Severity: Minor
    Found in salt/modules/zabbix.py - About 2 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 configuration_import has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
    Open

    def configuration_import(config_file, rules=None, file_format='xml', **kwargs):
        '''
        .. versionadded:: 2017.7
    
        Imports Zabbix configuration specified in file to Zabbix server.
    Severity: Minor
    Found in salt/modules/zabbix.py - About 2 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 usergroup_get has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
    Open

    def usergroup_get(name=None, usrgrpids=None, userids=None, **kwargs):
        '''
        .. versionadded:: 2016.3.0
    
        Retrieve user groups according to the given parameters
    Severity: Minor
    Found in salt/modules/zabbix.py - About 2 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 substitute_params has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
    Open

    def substitute_params(input_object, extend_params=None, filter_key='name', **kwargs):
        '''
        .. versionadded:: 2017.7
    
        Go through Zabbix object params specification and if needed get given object ID from Zabbix API and put it back
    Severity: Minor
    Found in salt/modules/zabbix.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 triggerid_get has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
    Open

    def triggerid_get(hostid=None, trigger_desc=None, priority=4, **kwargs):
        '''
        .. versionadded:: Fluorine
    
        Retrieve trigger ID and description based in host ID and trigger description.
    Severity: Minor
    Found in salt/modules/zabbix.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 host_get has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
    Open

    def host_get(host=None, name=None, hostids=None, **kwargs):
        '''
        .. versionadded:: 2016.3.0
    
        Retrieve hosts according to the given parameters
    Severity: Minor
    Found in salt/modules/zabbix.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 hostgroup_get has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
    Open

    def hostgroup_get(name=None, groupids=None, hostids=None, **kwargs):
        '''
        .. versionadded:: 2016.3.0
    
        Retrieve host groups according to the given parameters
    Severity: Minor
    Found in salt/modules/zabbix.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 user_get has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
    Open

    def user_get(alias=None, userids=None, **kwargs):
        '''
        Retrieve users according to the given parameters.
    
        .. versionadded:: 2016.3.0
    Severity: Minor
    Found in salt/modules/zabbix.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 template_get has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
    Open

    def template_get(name=None, host=None, templateids=None, **kwargs):
        '''
        Retrieve templates according to the given parameters.
    
        Args:
    Severity: Minor
    Found in salt/modules/zabbix.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 usermacro_createglobal has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
    Open

    def usermacro_createglobal(macro, value, **kwargs):
        '''
        Create new global usermacro.
    
        :param macro: name of the global usermacro
    Severity: Minor
    Found in salt/modules/zabbix.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 host_inventory_set has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
    Open

    def host_inventory_set(hostid, **kwargs):
        '''
        Update host inventory items
        NOTE: This function accepts all standard host: keyword argument names for inventory
        see: https://www.zabbix.com/documentation/2.4/manual/api/reference/host/object#host_inventory
    Severity: Minor
    Found in salt/modules/zabbix.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 usermacro_create has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
    Open

    def usermacro_create(macro, value, hostid, **kwargs):
        '''
        Create new host usermacro.
    
        :param macro: name of the host usermacro
    Severity: Minor
    Found in salt/modules/zabbix.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 service_get has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
    Open

    def service_get(service_name=None, service_rootid=None, **kwargs):
        '''
        .. versionadded:: Fluorine
    
        Get service according to name and parent service ID.
    Severity: Minor
    Found in salt/modules/zabbix.py - About 55 mins 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 host_create has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
    Open

    def host_create(host, groups, interfaces, **kwargs):
        '''
        .. versionadded:: 2016.3.0
    
        Create new host
    Severity: Minor
    Found in salt/modules/zabbix.py - About 55 mins 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 mediatype_get has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
    Open

    def mediatype_get(name=None, mediatypeids=None, **kwargs):
        '''
        Retrieve mediatypes according to the given parameters.
    
        Args:
    Severity: Minor
    Found in salt/modules/zabbix.py - About 55 mins 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 service_add has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
    Open

    def service_add(service_rootid=None, service_name=None, triggerid=None, **kwargs):
        '''
        .. versionadded:: Fluorine
    
        Create service under service with id specified as parameter.
    Severity: Minor
    Found in salt/modules/zabbix.py - About 55 mins 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

    Avoid deeply nested control flow statements.
    Open

                            if comp or (not comp and isinstance(comp, list)):
                                diffdict['new'].update({i: defined[i]})
                                diffdict['old'].update({i: existing[i]})
                        else:
    Severity: Major
    Found in salt/modules/zabbix.py - About 45 mins to fix

      Avoid deeply nested control flow statements.
      Open

                          if return_old_value:
                              d_in_e.append(comp['new'])
                          else:
                              d_in_e.append(comp)
                      if all(d_in_e):
      Severity: Major
      Found in salt/modules/zabbix.py - About 45 mins to fix

        Avoid deeply nested control flow statements.
        Open

                                if comp or (not comp and isinstance(comp, list)):
                                    diffdict.update({i: defined[i]})
                        return diffdict
        Severity: Major
        Found in salt/modules/zabbix.py - About 45 mins to fix

          Function host_inventory_get has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
          Open

          def host_inventory_get(hostids, **kwargs):
              '''
              Retrieve host inventory according to the given parameters.
              See: https://www.zabbix.com/documentation/2.4/manual/api/reference/host/object#host_inventory
          
          
          Severity: Minor
          Found in salt/modules/zabbix.py - About 35 mins 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 user_create has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
          Open

          def user_create(alias, passwd, usrgrps, **kwargs):
              '''
              .. versionadded:: 2016.3.0
          
              Create new zabbix user
          Severity: Minor
          Found in salt/modules/zabbix.py - About 35 mins 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 user_addmedia has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
          Open

          def user_addmedia(userids, active, mediatypeid, period, sendto, severity, **kwargs):
              '''
              Add new media to multiple users.
          
              .. versionadded:: 2016.3.0
          Severity: Minor
          Found in salt/modules/zabbix.py - About 35 mins 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_query has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
          Open

          def run_query(method, params, **kwargs):
              '''
              Send Zabbix API call
          
              Args:
          Severity: Minor
          Found in salt/modules/zabbix.py - About 35 mins 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 service_delete has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
          Open

          def service_delete(service_id=None, **kwargs):
              '''
              .. versionadded:: Fluorine
          
              Delete service specified by id.
          Severity: Minor
          Found in salt/modules/zabbix.py - About 35 mins 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 _params_extend has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
          Open

          def _params_extend(params, _ignore_name=False, **kwargs):
              '''
              Extends the params dictionary by values from keyword arguments.
          
              .. versionadded:: 2016.3.0
          Severity: Minor
          Found in salt/modules/zabbix.py - About 35 mins 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 mediatype_update has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
          Open

          def mediatype_update(mediatypeid, name=False, mediatype=False, **kwargs):
              '''
              Update existing mediatype
          
              .. note::
          Severity: Minor
          Found in salt/modules/zabbix.py - About 35 mins 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 hostinterface_get has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
          Open

          def hostinterface_get(hostids, **kwargs):
              '''
              .. versionadded:: 2016.3.0
          
              Retrieve host groups according to the given parameters
          Severity: Minor
          Found in salt/modules/zabbix.py - About 35 mins 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

          Avoid too many return statements within this function.
          Open

                          return diffdict
          Severity: Major
          Found in salt/modules/zabbix.py - About 30 mins to fix

            Avoid too many return statements within this function.
            Open

                    return ret
            Severity: Major
            Found in salt/modules/zabbix.py - About 30 mins to fix

              Avoid too many return statements within this function.
              Open

                              return defined
              Severity: Major
              Found in salt/modules/zabbix.py - About 30 mins to fix

                Avoid too many return statements within this function.
                Open

                            return {'new': defined, 'old': existing} if return_old_value else defined
                Severity: Major
                Found in salt/modules/zabbix.py - About 30 mins to fix

                  Function hostgroup_delete has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                  Open

                  def hostgroup_delete(hostgroupids, **kwargs):
                      '''
                      Delete the host group.
                  
                      .. versionadded:: 2016.3.0
                  Severity: Minor
                  Found in salt/modules/zabbix.py - About 25 mins 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 usermacro_deleteglobal has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                  Open

                  def usermacro_deleteglobal(macroids, **kwargs):
                      '''
                      Delete global usermacros.
                  
                      :param macroids: macroids of the global usermacros
                  Severity: Minor
                  Found in salt/modules/zabbix.py - About 25 mins 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 user_delete has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                  Open

                  def user_delete(users, **kwargs):
                      '''
                      Delete zabbix users.
                  
                      .. versionadded:: 2016.3.0
                  Severity: Minor
                  Found in salt/modules/zabbix.py - About 25 mins 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 host_delete has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                  Open

                  def host_delete(hostids, **kwargs):
                      '''
                      Delete hosts.
                  
                      .. versionadded:: 2016.3.0
                  Severity: Minor
                  Found in salt/modules/zabbix.py - About 25 mins 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 hostinterface_delete has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                  Open

                  def hostinterface_delete(interfaceids, **kwargs):
                      '''
                      Delete host interface
                  
                      .. versionadded:: 2016.3.0
                  Severity: Minor
                  Found in salt/modules/zabbix.py - About 25 mins 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 user_getmedia has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                  Open

                  def user_getmedia(userids=None, **kwargs):
                      '''
                      .. versionadded:: 2016.3.0
                  
                      Retrieve media according to the given parameters
                  Severity: Minor
                  Found in salt/modules/zabbix.py - About 25 mins 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 usermacro_delete has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                  Open

                  def usermacro_delete(macroids, **kwargs):
                      '''
                      Delete host usermacros.
                  
                      :param macroids: macroids of the host usermacros
                  Severity: Minor
                  Found in salt/modules/zabbix.py - About 25 mins 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 mediatype_delete has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                  Open

                  def mediatype_delete(mediatypeids, **kwargs):
                      '''
                      Delete mediatype
                  
                  
                  
                  Severity: Minor
                  Found in salt/modules/zabbix.py - About 25 mins 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

                  Similar blocks of code found in 2 locations. Consider refactoring.
                  Open

                  def usermacro_updateglobal(globalmacroid, value, **kwargs):
                      '''
                      Update existing global usermacro.
                  
                      :param globalmacroid: id of the host usermacro
                  Severity: Major
                  Found in salt/modules/zabbix.py and 1 other location - About 1 day to fix
                  salt/modules/zabbix.py on lines 2108..2140

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 134.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

                  Similar blocks of code found in 2 locations. Consider refactoring.
                  Open

                  def usermacro_update(hostmacroid, value, **kwargs):
                      '''
                      Update existing host usermacro.
                  
                      :param hostmacroid: id of the host usermacro
                  Severity: Major
                  Found in salt/modules/zabbix.py and 1 other location - About 1 day to fix
                  salt/modules/zabbix.py on lines 2143..2175

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 134.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

                  Identical blocks of code found in 2 locations. Consider refactoring.
                  Open

                              if macro:
                                  # Python mistakenly interprets macro names starting and ending with '{' and '}' as a dict
                                  if isinstance(macro, dict):
                                      macro = "{" + six.text_type(macro.keys()[0]) +"}"
                                  if not macro.startswith('{') and not macro.endswith('}'):
                  Severity: Major
                  Found in salt/modules/zabbix.py and 1 other location - About 6 hrs to fix
                  salt/modules/zabbix.py on lines 1979..1985

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 103.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

                  Identical blocks of code found in 2 locations. Consider refactoring.
                  Open

                              if macro:
                                  # Python mistakenly interprets macro names starting and ending with '{' and '}' as a dict
                                  if isinstance(macro, dict):
                                      macro = "{" + six.text_type(macro.keys()[0]) +"}"
                                  if not macro.startswith('{') and not macro.endswith('}'):
                  Severity: Major
                  Found in salt/modules/zabbix.py and 1 other location - About 6 hrs to fix
                  salt/modules/zabbix.py on lines 2021..2027

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 103.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

                  Similar blocks of code found in 3 locations. Consider refactoring.
                  Open

                  def host_delete(hostids, **kwargs):
                      '''
                      Delete hosts.
                  
                      .. versionadded:: 2016.3.0
                  Severity: Major
                  Found in salt/modules/zabbix.py and 2 other locations - About 6 hrs to fix
                  salt/modules/zabbix.py on lines 512..545
                  salt/modules/zabbix.py on lines 1482..1514

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 111.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

                  Similar blocks of code found in 3 locations. Consider refactoring.
                  Open

                  def user_delete(users, **kwargs):
                      '''
                      Delete zabbix users.
                  
                      .. versionadded:: 2016.3.0
                  Severity: Major
                  Found in salt/modules/zabbix.py and 2 other locations - About 6 hrs to fix
                  salt/modules/zabbix.py on lines 1126..1158
                  salt/modules/zabbix.py on lines 1482..1514

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 111.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

                  Similar blocks of code found in 3 locations. Consider refactoring.
                  Open

                  def hostgroup_delete(hostgroupids, **kwargs):
                      '''
                      Delete the host group.
                  
                      .. versionadded:: 2016.3.0
                  Severity: Major
                  Found in salt/modules/zabbix.py and 2 other locations - About 6 hrs to fix
                  salt/modules/zabbix.py on lines 512..545
                  salt/modules/zabbix.py on lines 1126..1158

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 111.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

                  Similar blocks of code found in 2 locations. Consider refactoring.
                  Open

                  def user_deletemedia(mediaids, **kwargs):
                      '''
                      Delete media by id.
                  
                      .. versionadded:: 2016.3.0
                  Severity: Major
                  Found in salt/modules/zabbix.py and 1 other location - About 6 hrs to fix
                  salt/modules/zabbix.py on lines 855..885

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 110.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

                  Similar blocks of code found in 2 locations. Consider refactoring.
                  Open

                  def usergroup_delete(usergroupids, **kwargs):
                      '''
                      .. versionadded:: 2016.3.0
                  
                      :param usergroupids: IDs of the user groups to delete
                  Severity: Major
                  Found in salt/modules/zabbix.py and 1 other location - About 6 hrs to fix
                  salt/modules/zabbix.py on lines 750..782

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 110.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

                  Similar blocks of code found in 2 locations. Consider refactoring.
                  Open

                  def host_update(hostid, **kwargs):
                      '''
                      .. versionadded:: 2016.3.0
                  
                      Update existing hosts
                  Severity: Major
                  Found in salt/modules/zabbix.py and 1 other location - About 6 hrs to fix
                  salt/modules/zabbix.py on lines 620..656

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 109.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

                  Similar blocks of code found in 2 locations. Consider refactoring.
                  Open

                  def user_update(userid, **kwargs):
                      '''
                      .. versionadded:: 2016.3.0
                  
                      Update existing users
                  Severity: Major
                  Found in salt/modules/zabbix.py and 1 other location - About 6 hrs to fix
                  salt/modules/zabbix.py on lines 1276..1318

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 109.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

                  Similar blocks of code found in 4 locations. Consider refactoring.
                  Open

                  def mediatype_delete(mediatypeids, **kwargs):
                      '''
                      Delete mediatype
                  
                  
                  
                  Severity: Major
                  Found in salt/modules/zabbix.py and 3 other locations - About 6 hrs to fix
                  salt/modules/zabbix.py on lines 1817..1849
                  salt/modules/zabbix.py on lines 2038..2070
                  salt/modules/zabbix.py on lines 2073..2105

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 107.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

                  Similar blocks of code found in 4 locations. Consider refactoring.
                  Open

                  def usermacro_delete(macroids, **kwargs):
                      '''
                      Delete host usermacros.
                  
                      :param macroids: macroids of the host usermacros
                  Severity: Major
                  Found in salt/modules/zabbix.py and 3 other locations - About 6 hrs to fix
                  salt/modules/zabbix.py on lines 1817..1849
                  salt/modules/zabbix.py on lines 2073..2105
                  salt/modules/zabbix.py on lines 2271..2302

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 107.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

                  Similar blocks of code found in 4 locations. Consider refactoring.
                  Open

                  def usermacro_deleteglobal(macroids, **kwargs):
                      '''
                      Delete global usermacros.
                  
                      :param macroids: macroids of the global usermacros
                  Severity: Major
                  Found in salt/modules/zabbix.py and 3 other locations - About 6 hrs to fix
                  salt/modules/zabbix.py on lines 1817..1849
                  salt/modules/zabbix.py on lines 2038..2070
                  salt/modules/zabbix.py on lines 2271..2302

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 107.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

                  Similar blocks of code found in 4 locations. Consider refactoring.
                  Open

                  def hostinterface_delete(interfaceids, **kwargs):
                      '''
                      Delete host interface
                  
                      .. versionadded:: 2016.3.0
                  Severity: Major
                  Found in salt/modules/zabbix.py and 3 other locations - About 6 hrs to fix
                  salt/modules/zabbix.py on lines 2038..2070
                  salt/modules/zabbix.py on lines 2073..2105
                  salt/modules/zabbix.py on lines 2271..2302

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 107.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

                  Similar blocks of code found in 4 locations. Consider refactoring.
                  Open

                  def hostgroup_create(name, **kwargs):
                      '''
                      .. versionadded:: 2016.3.0
                  
                      Create a host group
                  Severity: Major
                  Found in salt/modules/zabbix.py and 3 other locations - About 5 hrs to fix
                  salt/modules/zabbix.py on lines 816..852
                  salt/modules/zabbix.py on lines 998..1034
                  salt/modules/zabbix.py on lines 1852..1891

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 105.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

                  Similar blocks of code found in 4 locations. Consider refactoring.
                  Open

                  def hostinterface_update(interfaceid, **kwargs):
                      '''
                      .. versionadded:: 2016.3.0
                  
                      Update host interface
                  Severity: Major
                  Found in salt/modules/zabbix.py and 3 other locations - About 5 hrs to fix
                  salt/modules/zabbix.py on lines 816..852
                  salt/modules/zabbix.py on lines 998..1034
                  salt/modules/zabbix.py on lines 1443..1479

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 105.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

                  Similar blocks of code found in 4 locations. Consider refactoring.
                  Open

                  def usergroup_update(usrgrpid, **kwargs):
                      '''
                      .. versionadded:: 2016.3.0
                  
                      Update existing user group
                  Severity: Major
                  Found in salt/modules/zabbix.py and 3 other locations - About 5 hrs to fix
                  salt/modules/zabbix.py on lines 816..852
                  salt/modules/zabbix.py on lines 1443..1479
                  salt/modules/zabbix.py on lines 1852..1891

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 105.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

                  Similar blocks of code found in 4 locations. Consider refactoring.
                  Open

                  def usergroup_create(name, **kwargs):
                      '''
                      .. versionadded:: 2016.3.0
                  
                      Create new user group
                  Severity: Major
                  Found in salt/modules/zabbix.py and 3 other locations - About 5 hrs to fix
                  salt/modules/zabbix.py on lines 998..1034
                  salt/modules/zabbix.py on lines 1443..1479
                  salt/modules/zabbix.py on lines 1852..1891

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 105.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

                  Similar blocks of code found in 4 locations. Consider refactoring.
                  Open

                  def hostgroup_list(**kwargs):
                      '''
                      Retrieve all host groups.
                  
                      .. versionadded:: 2016.3.0
                  Severity: Major
                  Found in salt/modules/zabbix.py and 3 other locations - About 4 hrs to fix
                  salt/modules/zabbix.py on lines 785..813
                  salt/modules/zabbix.py on lines 1037..1065
                  salt/modules/zabbix.py on lines 1412..1440

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 86.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

                  Similar blocks of code found in 4 locations. Consider refactoring.
                  Open

                  def host_list(**kwargs):
                      '''
                      Retrieve all hosts.
                  
                      .. versionadded:: 2016.3.0
                  Severity: Major
                  Found in salt/modules/zabbix.py and 3 other locations - About 4 hrs to fix
                  salt/modules/zabbix.py on lines 785..813
                  salt/modules/zabbix.py on lines 1037..1065
                  salt/modules/zabbix.py on lines 1672..1700

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 86.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

                  Similar blocks of code found in 4 locations. Consider refactoring.
                  Open

                  def usergroup_list(**kwargs):
                      '''
                      Retrieve all enabled user groups.
                  
                      .. versionadded:: 2016.3.0
                  Severity: Major
                  Found in salt/modules/zabbix.py and 3 other locations - About 4 hrs to fix
                  salt/modules/zabbix.py on lines 785..813
                  salt/modules/zabbix.py on lines 1412..1440
                  salt/modules/zabbix.py on lines 1672..1700

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 86.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

                  Similar blocks of code found in 4 locations. Consider refactoring.
                  Open

                  def user_list(**kwargs):
                      '''
                      Retrieve all of the configured users.
                  
                      .. versionadded:: 2016.3.0
                  Severity: Major
                  Found in salt/modules/zabbix.py and 3 other locations - About 4 hrs to fix
                  salt/modules/zabbix.py on lines 1037..1065
                  salt/modules/zabbix.py on lines 1412..1440
                  salt/modules/zabbix.py on lines 1672..1700

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 86.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

                  Identical blocks of code found in 3 locations. Consider refactoring.
                  Open

                                  if _LooseVersion(zabbix_version) < _LooseVersion("2.4"):
                                      if node:
                                          params['node'] = node
                                      if nodeids:
                                          params['nodeids'] = nodeids
                  Severity: Major
                  Found in salt/modules/zabbix.py and 2 other locations - About 1 hr to fix
                  salt/modules/zabbix.py on lines 930..934
                  salt/modules/zabbix.py on lines 1560..1564

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 48.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

                  Identical blocks of code found in 3 locations. Consider refactoring.
                  Open

                                  if _LooseVersion(zabbix_version) < _LooseVersion("2.4"):
                                      if node:
                                          params['node'] = node
                                      if nodeids:
                                          params['nodeids'] = nodeids
                  Severity: Major
                  Found in salt/modules/zabbix.py and 2 other locations - About 1 hr to fix
                  salt/modules/zabbix.py on lines 1209..1213
                  salt/modules/zabbix.py on lines 1560..1564

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 48.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

                  Identical blocks of code found in 3 locations. Consider refactoring.
                  Open

                                  if _LooseVersion(zabbix_version) < _LooseVersion("2.4"):
                                      if node:
                                          params['node'] = node
                                      if nodeids:
                                          params['nodeids'] = nodeids
                  Severity: Major
                  Found in salt/modules/zabbix.py and 2 other locations - About 1 hr to fix
                  salt/modules/zabbix.py on lines 930..934
                  salt/modules/zabbix.py on lines 1209..1213

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 48.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

                  Similar blocks of code found in 2 locations. Consider refactoring.
                  Open

                          for rule in rules:
                              if rule in new_rules:
                                  new_rules[rule].update(rules[rule])
                              else:
                                  new_rules[rule] = rules[rule]
                  Severity: Major
                  Found in salt/modules/zabbix.py and 1 other location - About 1 hr to fix
                  salt/utils/minions.py on lines 879..883

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 49.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

                  There are no issues that match your filters.

                  Category
                  Status