saltstack/salt

View on GitHub
salt/modules/win_lgpo.py

Summary

Maintainability
F
2 mos
Test Coverage

File win_lgpo.py has 7592 lines of code (exceeds 250 allowed). Consider refactoring.
Invalid

# -*- coding: utf-8 -*-
'''
Manage Local Policy on Windows

This module allows configuring local group policy (i.e. ``gpedit.msc``) on a
Severity: Major
Found in salt/modules/win_lgpo.py - About 3 wks to fix

    Function _checkAllAdmxPolicies has a Cognitive Complexity of 519 (exceeds 5 allowed). Consider refactoring.
    Open

    def _checkAllAdmxPolicies(policy_class,
                              adml_language='en-US',
                              return_full_policy_names=False,
                              hierarchical_return=False,
                              return_not_configured=False):
    Severity: Minor
    Found in salt/modules/win_lgpo.py - About 1 wk to fix

    Cognitive Complexity

    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

    A method's cognitive complexity is based on a few simple rules:

    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
    • Code is considered more complex for each "break in the linear flow of the code"
    • Code is considered more complex when "flow breaking structures are nested"

    Further reading

    Function set_ has a Cognitive Complexity of 484 (exceeds 5 allowed). Consider refactoring.
    Open

    def set_(computer_policy=None,
             user_policy=None,
             cumulative_rights_assignments=True,
             adml_language='en-US'):
        '''
    Severity: Minor
    Found in salt/modules/win_lgpo.py - About 1 wk 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 _writeAdminTemplateRegPolFile has a Cognitive Complexity of 335 (exceeds 5 allowed). Consider refactoring.
    Open

    def _writeAdminTemplateRegPolFile(admtemplate_data,
                                      adml_language='en-US',
                                      registry_class='Machine'):
        r'''
        helper function to prep/write adm template data to the Registry.pol file
    Severity: Minor
    Found in salt/modules/win_lgpo.py - About 6 days 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 _lookup_admin_template has a Cognitive Complexity of 168 (exceeds 5 allowed). Consider refactoring.
    Open

    def _lookup_admin_template(policy_name,
                               policy_class,
                               adml_language='en-US'):
        '''
        (success_flag, policy_xml_item, policy_name_list, message)
    Severity: Minor
    Found in salt/modules/win_lgpo.py - About 3 days 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 _processValueItem has a Cognitive Complexity of 138 (exceeds 5 allowed). Consider refactoring.
    Open

    def _processValueItem(element, reg_key, reg_valuename, policy, parent_element,
                          check_deleted=False, this_element_value=None):
        '''
        helper function to process a value type item and generate the expected
        string in the Registry.pol file
    Severity: Minor
    Found in salt/modules/win_lgpo.py - About 2 days 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 _checkAllAdmxPolicies. (128)
    Open

    def _checkAllAdmxPolicies(policy_class,
                              adml_language='en-US',
                              return_full_policy_names=False,
                              hierarchical_return=False,
                              return_not_configured=False):
    Severity: Minor
    Found in salt/modules/win_lgpo.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

    Cyclomatic complexity is too high in function set_. (86)
    Open

    def set_(computer_policy=None,
             user_policy=None,
             cumulative_rights_assignments=True,
             adml_language='en-US'):
        '''
    Severity: Minor
    Found in salt/modules/win_lgpo.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 get has a Cognitive Complexity of 78 (exceeds 5 allowed). Consider refactoring.
    Open

    def get(policy_class=None, return_full_policy_names=True,
            hierarchical_return=False, adml_language='en-US',
            return_not_configured=False):
        '''
        Get a policy value
    Severity: Minor
    Found in salt/modules/win_lgpo.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 _load_policy_definitions has a Cognitive Complexity of 75 (exceeds 5 allowed). Consider refactoring.
    Open

    def _load_policy_definitions(path='c:\\Windows\\PolicyDefinitions',
                                 language='en-US'):
        '''
        helper function to process all ADMX files in the specified policy_def_path
        and build a single XML doc that we can search/use for ADMX policy processing
    Severity: Minor
    Found in salt/modules/win_lgpo.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

    Cyclomatic complexity is too high in function _writeAdminTemplateRegPolFile. (70)
    Open

    def _writeAdminTemplateRegPolFile(admtemplate_data,
                                      adml_language='en-US',
                                      registry_class='Machine'):
        r'''
        helper function to prep/write adm template data to the Registry.pol file
    Severity: Minor
    Found in salt/modules/win_lgpo.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 _getAdmlPresentationRefId has a Cognitive Complexity of 63 (exceeds 5 allowed). Consider refactoring.
    Open

    def _getAdmlPresentationRefId(adml_data, ref_id):
        '''
        helper function to check for a presentation label for a policy element
        '''
        search_results = adml_data.xpath('//*[@*[local-name() = "refId"] = "{0}"]'.format(ref_id))
    Severity: Minor
    Found in salt/modules/win_lgpo.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 _getDataFromRegPolData has a Cognitive Complexity of 63 (exceeds 5 allowed). Consider refactoring.
    Open

    def _getDataFromRegPolData(search_string, policy_data, return_value_name=False):
        '''
        helper function to do a search of Policy data from a registry.pol file
        returns the "data" field
        https://msdn.microsoft.com/en-us/library/aa374407(VS.85).aspx
    Severity: Minor
    Found in salt/modules/win_lgpo.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

    Cyclomatic complexity is too high in function _processValueItem. (59)
    Open

    def _processValueItem(element, reg_key, reg_valuename, policy, parent_element,
                          check_deleted=False, this_element_value=None):
        '''
        helper function to process a value type item and generate the expected
        string in the Registry.pol file
    Severity: Minor
    Found in salt/modules/win_lgpo.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 _dict_lookup_bitwise_add has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring.
    Open

        def _dict_lookup_bitwise_add(cls, item, **kwargs):
            '''
            kwarg value_lookup bool to determine if item_list should be compared to keys
            or values
    
    
    Severity: Minor
    Found in salt/modules/win_lgpo.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 _checkListItem has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring.
    Open

    def _checkListItem(policy_element, policy_name, policy_key, xpath_object, policy_file_data, test_items=True):
        '''
        helper function to process an enabled/disabled/true/falseList set
    
        if test_items is True, it will determine if the policy is enabled or
    Severity: Minor
    Found in salt/modules/win_lgpo.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

    Cyclomatic complexity is too high in function _lookup_admin_template. (35)
    Open

    def _lookup_admin_template(policy_name,
                               policy_class,
                               adml_language='en-US'):
        '''
        (success_flag, policy_xml_item, policy_name_list, message)
    Severity: Minor
    Found in salt/modules/win_lgpo.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 _getScriptSettingsFromIniFile has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
    Open

    def _getScriptSettingsFromIniFile(policy_info):
        '''
        helper function to parse/read a GPO Startup/Shutdown script file
    
        psscript.ini and script.ini file definitions are here
    Severity: Minor
    Found in salt/modules/win_lgpo.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

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

    def get_policy_info(policy_name,
                        policy_class,
                        adml_language='en-US'):
        r'''
        Returns information about a specified policy
    Severity: Minor
    Found in salt/modules/win_lgpo.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

    Cyclomatic complexity is too high in function get. (27)
    Open

    def get(policy_class=None, return_full_policy_names=True,
            hierarchical_return=False, adml_language='en-US',
            return_not_configured=False):
        '''
        Get a policy value
    Severity: Minor
    Found in salt/modules/win_lgpo.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 _write_regpol_data has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
    Open

    def _write_regpol_data(data_to_write,
                           policy_file_path,
                           gpt_ini_path,
                           gpt_extension,
                           gpt_extension_guid):
    Severity: Minor
    Found in salt/modules/win_lgpo.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

    _policy_info has 23 functions (exceeds 20 allowed). Consider refactoring.
    Open

    class _policy_info(object):
        r'''
        Policy Helper Class
        ===================
    
    
    Severity: Minor
    Found in salt/modules/win_lgpo.py - About 2 hrs to fix

      Cyclomatic complexity is too high in function _getAdmlPresentationRefId. (24)
      Open

      def _getAdmlPresentationRefId(adml_data, ref_id):
          '''
          helper function to check for a presentation label for a policy element
          '''
          search_results = adml_data.xpath('//*[@*[local-name() = "refId"] = "{0}"]'.format(ref_id))
      Severity: Minor
      Found in salt/modules/win_lgpo.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 _set_netsh_value has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
      Open

      def _set_netsh_value(profile, section, option, value):
          if section not in ('firewallpolicy', 'settings', 'logging', 'state'):
              raise ValueError('LGPO: Invalid section: {0}'.format(section))
          log.debug('LGPO: Setting the following\n'
                    'Profile: %s\n'
      Severity: Minor
      Found in salt/modules/win_lgpo.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 _validateSetting has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
      Open

      def _validateSetting(value, policy):
          '''
          helper function to validate specified value is appropriate for the policy
          if the 'Settings' key is a list, the value will check that it is in the list
          if the 'Settings' key is a dict we will try to execute the function name
      Severity: Minor
      Found in salt/modules/win_lgpo.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 _dict_lookup has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
      Open

          def _dict_lookup(cls, item, **kwargs):
              '''
              Retrieves the key or value from a dict based on the item
              kwarg lookup dict to search for item
              kwarg value_lookup bool to determine if item should be compared to keys
      Severity: Minor
      Found in salt/modules/win_lgpo.py - About 1 hr to fix

      Cognitive Complexity

      Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

      A method's cognitive complexity is based on a few simple rules:

      • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
      • Code is considered more complex for each "break in the linear flow of the code"
      • Code is considered more complex when "flow breaking structures are nested"

      Further reading

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

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

        Consider simplifying this complex logical expression.
        Open

                                                        if etree.QName(child_item).localname == 'boolean' and (
                                                                TRUE_LIST_XPATH(child_item) or FALSE_LIST_XPATH(child_item)):
                                                            list_strings = []
                                                            if base_policy_settings[adm_namespace][admPolicy][child_item.attrib['id']]:
                                                                list_strings = _checkListItem(child_item,
        Severity: Critical
        Found in salt/modules/win_lgpo.py - About 1 hr to fix

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

          def _transform_value(value, policy, transform_type):
              '''
              helper function to transform the policy value into something that more
              closely matches how the policy is displayed in the gpedit GUI
              '''
          Severity: Minor
          Found in salt/modules/win_lgpo.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 _driver_signing_reg_conversion has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
          Open

              def _driver_signing_reg_conversion(cls, val, **kwargs):
                  '''
                  converts the binary value in the registry for driver signing into the
                  correct string representation
                  '''
          Severity: Minor
          Found in salt/modules/win_lgpo.py - About 1 hr to fix

          Cognitive Complexity

          Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

          A method's cognitive complexity is based on a few simple rules:

          • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
          • Code is considered more complex for each "break in the linear flow of the code"
          • Code is considered more complex when "flow breaking structures are nested"

          Further reading

          Function _set_audit_file_data has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
          Open

          def _set_audit_file_data(option, value):
              '''
              Helper function that sets the Advanced Audit settings in the two .csv files
              on Windows. Those files are located at:
              C:\\Windows\\Security\\Audit\\audit.csv
          Severity: Minor
          Found in salt/modules/win_lgpo.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 _in_range_inclusive has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
          Open

              def _in_range_inclusive(cls, val, **kwargs):
                  '''
                  checks that a value is in an inclusive range
                  The value for 0 used by Max Password Age is actually 0xffffffff
                  '''
          Severity: Minor
          Found in salt/modules/win_lgpo.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

          Consider simplifying this complex logical expression.
          Open

                                                      if etree.QName(child_item).localname == 'boolean' \
                                                              and (TRUE_LIST_XPATH(child_item) or FALSE_LIST_XPATH(child_item)):
                                                          # WARNING: no OOB adm files use true/falseList items
                                                          # this has not been fully vetted
                                                          temp_dict = {'trueList': TRUE_LIST_XPATH, 'falseList': FALSE_LIST_XPATH}
          Severity: Critical
          Found in salt/modules/win_lgpo.py - About 1 hr to fix

            Consider simplifying this complex logical expression.
            Open

                        if the_localname == 'textBox' \
                                or the_localname == 'comboBox':
                            label_items = result.xpath('.//*[local-name() = "label"]')
                            for label_item in label_items:
                                if label_item.text:
            Severity: Critical
            Found in salt/modules/win_lgpo.py - About 1 hr to fix

              Function _get_advaudit_defaults has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
              Open

              def _get_advaudit_defaults(option=None):
                  '''
                  Loads audit.csv defaults into a dict in __context__ called
                  'lgpo.audit_defaults'. The dictionary includes fieldnames and all
                  configurable policies as keys. The values are used to create/modify the
              Severity: Minor
              Found in salt/modules/win_lgpo.py - About 1 hr to fix

              Cognitive Complexity

              Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

              A method's cognitive complexity is based on a few simple rules:

              • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
              • Code is considered more complex for each "break in the linear flow of the code"
              • Code is considered more complex when "flow breaking structures are nested"

              Further reading

              Function _get_advaudit_value has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
              Open

              def _get_advaudit_value(option):
                  '''
                  Get the Advanced Auditing policy as configured in
                  ``C:\\Windows\\Security\\Audit\\audit.csv``
              
              
              Severity: Minor
              Found in salt/modules/win_lgpo.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 _buildKnownDataSearchString has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
              Open

              def _buildKnownDataSearchString(reg_key, reg_valueName, reg_vtype, reg_data,
                                              check_deleted=False):
                  '''
                  helper function similar to _processValueItem to build a search string for a
                  known key/value/type/data
              Severity: Minor
              Found in salt/modules/win_lgpo.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 _updateNamespace has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
              Open

              def _updateNamespace(item, new_namespace):
                  '''
                  helper function to recursively update the namespaces of an item
                  '''
                  temp_item = ''
              Severity: Minor
              Found in salt/modules/win_lgpo.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 _checkValueItemParent has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
              Open

              def _checkValueItemParent(policy_element, policy_name, policy_key,
                                        policy_valueName, xpath_object, policy_file_data,
                                        check_deleted=False, test_item=True):
                  '''
                  helper function to process the parent of a value item object
              Severity: Minor
              Found in salt/modules/win_lgpo.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 requested_val is not None:
                                      this_element_value = six.text_type(requested_val).encode('utf-16-le')
                          if check_deleted:
              Severity: Major
              Found in salt/modules/win_lgpo.py - About 45 mins to fix

                Avoid deeply nested control flow statements.
                Open

                                    if policy_info['ScriptIni']['SettingName'].lower() in [z.lower() for z in _existingData[policy_info['ScriptIni']['Section']].keys()]:
                                        return _existingData[policy_info['ScriptIni']['Section']][policy_info['ScriptIni']['SettingName'].lower()]
                                    else:
                                        return None
                                else:
                Severity: Major
                Found in salt/modules/win_lgpo.py - About 45 mins to fix

                  Avoid deeply nested control flow statements.
                  Open

                                      if not getattr(adml_search_result, 'text', '').strip() == policy_name:
                                          adml_to_remove.append(adml_search_result)
                                      else:
                                          if hierarchy:
                                              log.debug('we have hierarchy of %s', hierarchy)
                  Severity: Major
                  Found in salt/modules/win_lgpo.py - About 45 mins to fix

                    Avoid deeply nested control flow statements.
                    Open

                                        for _modal_set in _modal_sets:
                                            try:
                                                _existingModalData = win32net.NetUserModalsGet(None, _modal_set)
                                                _newModalSetData = dictupdate.update(_existingModalData, _modal_sets[_modal_set])
                                                log.debug('NEW MODAL SET = %s', _newModalSetData)
                    Severity: Major
                    Found in salt/modules/win_lgpo.py - About 45 mins to fix

                      Avoid deeply nested control flow statements.
                      Open

                                          if _pol['NetUserModal']['Modal'] not in modal_returns:
                                              modal_returns[_pol['NetUserModal']['Modal']] = win32net.NetUserModalsGet(
                                                      None,
                                                      _pol['NetUserModal']['Modal'])
                                          class_vals[policy_name] = modal_returns[_pol['NetUserModal']['Modal']][_pol['NetUserModal']['Option']]
                      Severity: Major
                      Found in salt/modules/win_lgpo.py - About 45 mins to fix

                        Avoid deeply nested control flow statements.
                        Open

                                            if policy_name in _policydata.policies[p_class]['policies']:
                                                _pol = _policydata.policies[p_class]['policies'][policy_name]
                                            else:
                                                for policy in _policydata.policies[p_class]['policies']:
                                                    if _policydata.policies[p_class]['policies'][policy]['Policy'].upper() == \
                        Severity: Major
                        Found in salt/modules/win_lgpo.py - About 45 mins to fix

                          Avoid deeply nested control flow statements.
                          Open

                                                  if not value == 'None':
                                                      # The value is not None, make the change
                                                      row['Inclusion Setting'] = auditpol_values[value]
                                                      row['Setting Value'] = value
                                                      log.debug('LGPO: Setting {0} to {1}'
                          Severity: Major
                          Found in salt/modules/win_lgpo.py - About 45 mins to fix

                            Avoid deeply nested control flow statements.
                            Open

                                                for regedit in _regedits:
                                                    log.debug('%s is a Registry policy', regedit)
                                                    # if the value setting is None or "(value not set)", we will delete the value from the registry
                                                    if _regedits[regedit]['value'] is not None and _regedits[regedit]['value'] != '(value not set)':
                                                        _ret = __utils__['reg.set_value'](
                            Severity: Major
                            Found in salt/modules/win_lgpo.py - About 45 mins to fix

                              Function _dasd_conversion has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                              Open

                                  def _dasd_conversion(cls, val, **kwargs):
                                      '''
                                      converts 0/1/2 for dasd reg key
                                      '''
                                      if val is not None:
                              Severity: Minor
                              Found in salt/modules/win_lgpo.py - About 45 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 this_policynamespace not in policy_vals:
                                                      policy_vals[this_policynamespace] = {}
                                                  policy_vals[this_policynamespace][this_policyname] = this_policy_setting
                              Severity: Major
                              Found in salt/modules/win_lgpo.py - About 45 mins to fix

                                Avoid deeply nested control flow statements.
                                Open

                                                    if this_policynamespace not in policy_vals:
                                                        policy_vals[this_policynamespace] = {}
                                                    policy_vals[this_policynamespace][this_policyname] = this_policy_setting
                                Severity: Major
                                Found in salt/modules/win_lgpo.py - About 45 mins to fix

                                  Avoid deeply nested control flow statements.
                                  Open

                                                      if this_policynamespace not in policy_vals:
                                                          policy_vals[this_policynamespace] = {}
                                                      policy_vals[this_policynamespace][this_policyname] = this_policy_setting
                                  Severity: Major
                                  Found in salt/modules/win_lgpo.py - About 45 mins to fix

                                    Avoid deeply nested control flow statements.
                                    Open

                                                        if policy_namespace not in unpathed_dict:
                                                            unpathed_dict[policy_namespace] = {}
                                                        unpathed_dict[policy_namespace][full_names[policy_namespace][policy_item]] = policy_item
                                    Severity: Major
                                    Found in salt/modules/win_lgpo.py - About 45 mins to fix

                                      Avoid deeply nested control flow statements.
                                      Open

                                                              if 'class' in this_policy.attrib:
                                                                  if this_policy.attrib['class'] == registry_class or this_policy.attrib['class'] == 'Both':
                                                                      if 'key' in this_policy.attrib:
                                                                          this_key = this_policy.attrib['key']
                                                                      else:
                                      Severity: Major
                                      Found in salt/modules/win_lgpo.py - About 45 mins to fix

                                        Avoid deeply nested control flow statements.
                                        Open

                                                            if (len(admx_search_results) == 1 or hierarchy) and not multiple_adml_entries:
                                                                found = False
                                                                for search_result in admx_search_results:
                                                                    found = False
                                                                    if hierarchy:
                                        Severity: Major
                                        Found in salt/modules/win_lgpo.py - About 45 mins to fix

                                          Avoid deeply nested control flow statements.
                                          Open

                                                              if not _ret:
                                                                  msg = ('Error while attempting to write Administrative Template Policy data.'
                                                                         '  Some changes may not be applied as expected')
                                                                  raise CommandExecutionError(msg)
                                                  return True
                                          Severity: Major
                                          Found in salt/modules/win_lgpo.py - About 45 mins to fix

                                            Avoid deeply nested control flow statements.
                                            Open

                                                                if vtype == 'REG_DWORD' or vtype == 'REG_QWORD':
                                                                    if value:
                                                                        if vtype == 'REG_DWORD':
                                                                            for v in struct.unpack(b'I', value):
                                                                                value = v
                                            Severity: Major
                                            Found in salt/modules/win_lgpo.py - About 45 mins to fix

                                              Avoid deeply nested control flow statements.
                                              Open

                                                                  for p_item in presentation_element.getchildren():
                                                                      if p_item == result:
                                                                          break
                                                                      else:
                                                                          if etree.QName(p_item.tag).localname == 'text':
                                              Severity: Major
                                              Found in salt/modules/win_lgpo.py - About 45 mins to fix

                                                Avoid deeply nested control flow statements.
                                                Open

                                                                    if this_element_value is not None:
                                                                        element_valuenames = ['{0}{1}'.format(
                                                                            element.attrib['valuePrefix'], k) for k in element_valuenames]
                                                            else:
                                                Severity: Major
                                                Found in salt/modules/win_lgpo.py - About 45 mins to fix

                                                  Avoid deeply nested control flow statements.
                                                  Open

                                                                      for setting in _netshs:
                                                                          log.debug('Setting firewall policy: %s', setting)
                                                                          log.debug(_netshs[setting])
                                                                          _set_netsh_value(**_netshs[setting])
                                                  
                                                  
                                                  Severity: Major
                                                  Found in salt/modules/win_lgpo.py - About 45 mins to fix

                                                    Avoid deeply nested control flow statements.
                                                    Open

                                                                        for setting in _advaudits:
                                                                            log.debug('Setting Advanced Audit policy: {0}'.format(setting))
                                                                            log.debug(_advaudits[setting])
                                                                            _set_advaudit_value(**_advaudits[setting])
                                                    
                                                    
                                                    Severity: Major
                                                    Found in salt/modules/win_lgpo.py - About 45 mins to fix

                                                      Avoid deeply nested control flow statements.
                                                      Open

                                                                              if k == 0:
                                                                                  do_test = False
                                                                          if do_test and isinstance(k, int) and item & k == k:
                                                      Severity: Major
                                                      Found in salt/modules/win_lgpo.py - About 45 mins to fix

                                                        Avoid deeply nested control flow statements.
                                                        Open

                                                                            if label_item.text:
                                                                                return (prepended_text + ' ' + label_item.text.rstrip().rstrip(':')).lstrip()
                                                                    elif the_localname == 'decimalTextBox' \
                                                        Severity: Major
                                                        Found in salt/modules/win_lgpo.py - About 45 mins to fix

                                                          Avoid deeply nested control flow statements.
                                                          Open

                                                                              for i, item in enumerate(element_valuenames):
                                                                                  expected_string = expected_string + b''.join(['['.encode('utf-16-le'),
                                                                                                                                reg_key,
                                                                                                                                encoded_null,
                                                                                                                                encoded_semicolon,
                                                          Severity: Major
                                                          Found in salt/modules/win_lgpo.py - About 45 mins to fix

                                                            Avoid deeply nested control flow statements.
                                                            Open

                                                                                if _pol:
                                                                                    # transform and validate the setting
                                                                                    _value = _transform_value(
                                                                                        value=policies[p_class][policy_name],
                                                                                        policy=_policydata.policies[p_class]['policies'][policy_key_name],
                                                            Severity: Major
                                                            Found in salt/modules/win_lgpo.py - About 45 mins to fix

                                                              Avoid deeply nested control flow statements.
                                                              Open

                                                                                  if hierarchy_item in policy_vals[policy_namespace]:
                                                                                      tdict = {}
                                                                                      first_item = True
                                                                                      for item in hierarchy[policy_namespace][hierarchy_item]:
                                                                                          newdict = {}
                                                              Severity: Major
                                                              Found in salt/modules/win_lgpo.py - About 45 mins to fix

                                                                Avoid deeply nested control flow statements.
                                                                Open

                                                                                    if _regexSearchRegPolData(re.escape(search_string), policy_file_data):
                                                                                        configured_items = configured_items + 1
                                                                                        log.debug('found the search string in the pol file,'
                                                                                                  '%s of %s items for policy %s are '
                                                                                                  'configured in registry.pol',
                                                                Severity: Major
                                                                Found in salt/modules/win_lgpo.py - About 45 mins to fix

                                                                  Avoid deeply nested control flow statements.
                                                                  Open

                                                                                      if this_policynamespace not in policy_vals:
                                                                                          policy_vals[this_policynamespace] = {}
                                                                                      policy_vals[this_policynamespace][this_policyname] = this_policy_setting
                                                                  Severity: Major
                                                                  Found in salt/modules/win_lgpo.py - About 45 mins to fix

                                                                    Avoid deeply nested control flow statements.
                                                                    Open

                                                                                        if this_policynamespace not in policy_vals:
                                                                                            policy_vals[this_policynamespace] = {}
                                                                                        policy_vals[this_policynamespace][this_policyname] = this_policy_setting
                                                                    Severity: Major
                                                                    Found in salt/modules/win_lgpo.py - About 45 mins to fix

                                                                      Avoid deeply nested control flow statements.
                                                                      Open

                                                                                          if prepended_text.endswith('.'):
                                                                                              prepended_text = ''
                                                                                  if the_localname == 'textBox' \
                                                                      Severity: Major
                                                                      Found in salt/modules/win_lgpo.py - About 45 mins to fix

                                                                        Avoid deeply nested control flow statements.
                                                                        Open

                                                                                            if element_only_enabled_disabled:
                                                                                                if required_elements \
                                                                                                            and len(configured_elements) == len(required_elements):
                                                                                                    if policy_disabled_elements == len(required_elements):
                                                                                                        log.debug('%s is disabled by all enum elements', this_policyname)
                                                                        Severity: Major
                                                                        Found in salt/modules/win_lgpo.py - About 45 mins to fix

                                                                          Avoid deeply nested control flow statements.
                                                                          Open

                                                                                                  if 'class' in this_policy.attrib:
                                                                                                      if this_policy.attrib['class'] == registry_class or this_policy.attrib['class'] == 'Both':
                                                                                                          if 'key' in this_policy.attrib:
                                                                                                              this_key = this_policy.attrib['key']
                                                                                                          else:
                                                                          Severity: Major
                                                                          Found in salt/modules/win_lgpo.py - About 45 mins to fix

                                                                            Avoid deeply nested control flow statements.
                                                                            Open

                                                                                                if not _write_secedit_data(_secedits):
                                                                                                    msg = ('Error while attempting to set policies via '
                                                                                                           'secedit. Some changes may not be applied as '
                                                                                                           'expected')
                                                                                                    raise CommandExecutionError(msg)
                                                                            Severity: Major
                                                                            Found in salt/modules/win_lgpo.py - About 45 mins to fix

                                                                              Function _dasd_reverse_conversion has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                                                                              Open

                                                                                  def _dasd_reverse_conversion(cls, val, **kwargs):
                                                                                      '''
                                                                                      converts DASD String values to the reg_sz value
                                                                                      '''
                                                                                      if val is not None:
                                                                              Severity: Minor
                                                                              Found in salt/modules/win_lgpo.py - About 45 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 _getFullPolicyName has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                                                                              Open

                                                                              def _getFullPolicyName(policy_item,
                                                                                                     policy_name,
                                                                                                     return_full_policy_names,
                                                                                                     adml_language):
                                                                                  '''
                                                                              Severity: Minor
                                                                              Found in salt/modules/win_lgpo.py - About 45 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 'key' in temp_pol.attrib:
                                                                                                      temp_pol = _updatePolicyElements(temp_pol, temp_pol.attrib['key'])
                                                                                                  policydefs_policies_xpath(t_policy_definitions)[0].append(temp_pol)
                                                                              Severity: Major
                                                                              Found in salt/modules/win_lgpo.py - About 45 mins to fix

                                                                                Avoid deeply nested control flow statements.
                                                                                Open

                                                                                                    if not_configured_policy_namespace not in full_names:
                                                                                                        full_names[not_configured_policy_namespace] = {}
                                                                                                    full_names[not_configured_policy_namespace][not_configured_policy.attrib['name']] = _getFullPolicyName(
                                                                                Severity: Major
                                                                                Found in salt/modules/win_lgpo.py - About 45 mins to fix

                                                                                  Avoid deeply nested control flow statements.
                                                                                  Open

                                                                                                      if requested_val is not None:
                                                                                                          this_element_value = six.text_type(requested_val).encode('utf-16-le')
                                                                                          elif etree.QName(element).localname == 'text':
                                                                                  Severity: Major
                                                                                  Found in salt/modules/win_lgpo.py - About 45 mins to fix

                                                                                    Avoid deeply nested control flow statements.
                                                                                    Open

                                                                                                        if etree.QName(admx_item).localname == 'policy':
                                                                                                            if admx_item not in admx_policies:
                                                                                                                admx_policies.append(admx_item)
                                                                                                        else:
                                                                                                            for policy_item in POLICY_ANCESTOR_XPATH(admx_item):
                                                                                    Severity: Major
                                                                                    Found in salt/modules/win_lgpo.py - About 45 mins to fix

                                                                                      Avoid deeply nested control flow statements.
                                                                                      Open

                                                                                                          if _policydata.policies[p_class]['policies'][policy]['Policy'].upper() == policy_name.upper():
                                                                                                              _pol = _policydata.policies[p_class]['policies'][policy]
                                                                                                              policy_name = policy
                                                                                                  if _pol:
                                                                                      Severity: Major
                                                                                      Found in salt/modules/win_lgpo.py - About 45 mins to fix

                                                                                        Avoid deeply nested control flow statements.
                                                                                        Open

                                                                                                            if 'lgpo_section' in _pol:
                                                                                                                firstItem = True
                                                                                                                tdict = {}
                                                                                                                for level in reversed(_pol['lgpo_section']):
                                                                                                                    newdict = {}
                                                                                        Severity: Major
                                                                                        Found in salt/modules/win_lgpo.py - About 45 mins to fix

                                                                                          Avoid deeply nested control flow statements.
                                                                                          Open

                                                                                                              if not __salt__['file.file_exists'](adml_file):
                                                                                                                  log.info('An ADML file in the specified ADML language '
                                                                                                                           'code %s does not exist for the ADMX "%s", '
                                                                                                                           'the fallback language will be tried.',
                                                                                                                           language[:2], t_admfile)
                                                                                          Severity: Major
                                                                                          Found in salt/modules/win_lgpo.py - About 45 mins to fix

                                                                                            Avoid deeply nested control flow statements.
                                                                                            Open

                                                                                                                if this_policynamespace not in policy_vals:
                                                                                                                    policy_vals[this_policynamespace] = {}
                                                                                                                policy_vals[this_policynamespace][this_policyname] = this_policy_setting
                                                                                            Severity: Major
                                                                                            Found in salt/modules/win_lgpo.py - About 45 mins to fix

                                                                                              Avoid deeply nested control flow statements.
                                                                                              Open

                                                                                                                  for elements_item in ELEMENTS_XPATH(admx_policy):
                                                                                                                      for child_item in elements_item.getchildren():
                                                                                                                          this_element_name = _getFullPolicyName(
                                                                                                                              policy_item=child_item,
                                                                                                                              policy_name=child_item.attrib['id'],
                                                                                              Severity: Major
                                                                                              Found in salt/modules/win_lgpo.py - About 45 mins to fix

                                                                                                Avoid deeply nested control flow statements.
                                                                                                Open

                                                                                                                    for lsaright in _lsarights:
                                                                                                                        _existingUsers = None
                                                                                                                        if not cumulative_rights_assignments:
                                                                                                                            _existingUsers = _getRightsAssignments(
                                                                                                                                    _lsarights[lsaright]['policy']['LsaRights']['Option'])
                                                                                                Severity: Major
                                                                                                Found in salt/modules/win_lgpo.py - About 45 mins to fix

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

                                                                                                      def _sidConversion(cls, val, **kwargs):
                                                                                                          '''
                                                                                                          converts a list of pysid objects to string representations
                                                                                                          '''
                                                                                                          if isinstance(val, six.string_types):
                                                                                                  Severity: Minor
                                                                                                  Found in salt/modules/win_lgpo.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 _driver_signing_reg_reverse_conversion has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                                                                                                  Open

                                                                                                      def _driver_signing_reg_reverse_conversion(cls, val, **kwargs):
                                                                                                          '''
                                                                                                          converts the string value seen in the GUI to the correct registry value
                                                                                                          for secedit
                                                                                                          '''
                                                                                                  Severity: Minor
                                                                                                  Found in salt/modules/win_lgpo.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 _getAdmlDisplayName has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                                                                                                  Open

                                                                                                  def _getAdmlDisplayName(adml_xml_data, display_name):
                                                                                                      '''
                                                                                                      helper function to take the 'displayName' attribute of an element and find
                                                                                                      the value from the ADML data
                                                                                                  
                                                                                                  
                                                                                                  Severity: Minor
                                                                                                  Found in salt/modules/win_lgpo.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 _binary_enable_zero_disable_one_conversion has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                                                                                                  Open

                                                                                                      def _binary_enable_zero_disable_one_conversion(cls, val, **kwargs):
                                                                                                          '''
                                                                                                          converts a binary 0/1 to Disabled/Enabled
                                                                                                          '''
                                                                                                          try:
                                                                                                  Severity: Minor
                                                                                                  Found in salt/modules/win_lgpo.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 'Not Defined'
                                                                                                  Severity: Major
                                                                                                  Found in salt/modules/win_lgpo.py - About 30 mins to fix

                                                                                                    Avoid too many return statements within this function.
                                                                                                    Open

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

                                                                                                      Avoid too many return statements within this function.
                                                                                                      Open

                                                                                                                      return 'Not Defined'
                                                                                                      Severity: Major
                                                                                                      Found in salt/modules/win_lgpo.py - About 30 mins to fix

                                                                                                        Avoid too many return statements within this function.
                                                                                                        Open

                                                                                                                                    return False, None, [], msg
                                                                                                        Severity: Major
                                                                                                        Found in salt/modules/win_lgpo.py - About 30 mins to fix

                                                                                                          Avoid too many return statements within this function.
                                                                                                          Open

                                                                                                                      return 'Not Defined'
                                                                                                          Severity: Major
                                                                                                          Found in salt/modules/win_lgpo.py - About 30 mins to fix

                                                                                                            Avoid too many return statements within this function.
                                                                                                            Open

                                                                                                                                return 'Invalid Value'
                                                                                                            Severity: Major
                                                                                                            Found in salt/modules/win_lgpo.py - About 30 mins to fix

                                                                                                              Avoid too many return statements within this function.
                                                                                                              Open

                                                                                                                          return 'Not Defined'
                                                                                                              Severity: Major
                                                                                                              Found in salt/modules/win_lgpo.py - About 30 mins to fix

                                                                                                                Avoid too many return statements within this function.
                                                                                                                Open

                                                                                                                            return 'Invalid Value'
                                                                                                                Severity: Major
                                                                                                                Found in salt/modules/win_lgpo.py - About 30 mins to fix

                                                                                                                  Avoid too many return statements within this function.
                                                                                                                  Open

                                                                                                                              return 'Not Defined'
                                                                                                                  Severity: Major
                                                                                                                  Found in salt/modules/win_lgpo.py - About 30 mins to fix

                                                                                                                    Avoid too many return statements within this function.
                                                                                                                    Open

                                                                                                                        return False, None, [], \
                                                                                                                    Severity: Major
                                                                                                                    Found in salt/modules/win_lgpo.py - About 30 mins to fix

                                                                                                                      Avoid too many return statements within this function.
                                                                                                                      Open

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

                                                                                                                        Avoid too many return statements within this function.
                                                                                                                        Open

                                                                                                                                        return False, None, [], \
                                                                                                                        Severity: Major
                                                                                                                        Found in salt/modules/win_lgpo.py - About 30 mins to fix

                                                                                                                          Avoid too many return statements within this function.
                                                                                                                          Open

                                                                                                                                          return 'Invalid Value'
                                                                                                                          Severity: Major
                                                                                                                          Found in salt/modules/win_lgpo.py - About 30 mins to fix

                                                                                                                            Avoid too many return statements within this function.
                                                                                                                            Open

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

                                                                                                                              Avoid too many return statements within this function.
                                                                                                                              Open

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

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

                                                                                                                                    def _binary_enable_zero_disable_one_reverse_conversion(cls, val, **kwargs):
                                                                                                                                        '''
                                                                                                                                        converts Enabled/Disabled to unicode char to write to a REG_BINARY value
                                                                                                                                        '''
                                                                                                                                        if val is not None:
                                                                                                                                Severity: Minor
                                                                                                                                Found in salt/modules/win_lgpo.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 _get_secedit_data has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                                                                                                                Open

                                                                                                                                def _get_secedit_data():
                                                                                                                                    '''
                                                                                                                                    Helper function that returns the secedit data in __context__ if it exists
                                                                                                                                    and puts the secedit data in __context__ if it does not.
                                                                                                                                
                                                                                                                                
                                                                                                                                Severity: Minor
                                                                                                                                Found in salt/modules/win_lgpo.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 _multi_string_put_transform has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                                                                                                                Open

                                                                                                                                    def _multi_string_put_transform(cls, item, **kwargs):
                                                                                                                                        '''
                                                                                                                                        transform for a REG_MULTI_SZ to properly handle "Not Defined"
                                                                                                                                        '''
                                                                                                                                        if isinstance(item, list):
                                                                                                                                Severity: Minor
                                                                                                                                Found in salt/modules/win_lgpo.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 _write_secedit_data has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                                                                                                                Open

                                                                                                                                def _write_secedit_data(secedit_data):
                                                                                                                                    '''
                                                                                                                                    Helper function to write secedit data to the database
                                                                                                                                    '''
                                                                                                                                    # Set file names
                                                                                                                                Severity: Minor
                                                                                                                                Found in salt/modules/win_lgpo.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 _regexSearchRegPolData has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                                                                                                                Open

                                                                                                                                def _regexSearchRegPolData(search_string, policy_data):
                                                                                                                                    '''
                                                                                                                                    helper function to do a search of Policy data from a registry.pol file
                                                                                                                                    returns True if the regex search_string is found, otherwise False
                                                                                                                                    '''
                                                                                                                                Severity: Minor
                                                                                                                                Found in salt/modules/win_lgpo.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 _updatePolicyElements has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                                                                                                                Open

                                                                                                                                def _updatePolicyElements(policy_item, regkey):
                                                                                                                                    '''
                                                                                                                                    helper function to add the reg key to each policies element definitions if
                                                                                                                                    the key attribute is not defined to make xpath searching easier for each
                                                                                                                                    child in the policy <elements> item
                                                                                                                                Severity: Minor
                                                                                                                                Found in salt/modules/win_lgpo.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

                                                                                                                                                    if policy_name in _policydata.policies[p_class]['policies']:
                                                                                                                                                        _pol = _policydata.policies[p_class]['policies'][policy_name]
                                                                                                                                                    else:
                                                                                                                                                        for policy in _policydata.policies[p_class]['policies']:
                                                                                                                                                            if _policydata.policies[p_class]['policies'][policy]['Policy'].upper() == \
                                                                                                                                Severity: Major
                                                                                                                                Found in salt/modules/win_lgpo.py and 1 other location - About 1 day to fix
                                                                                                                                salt/modules/win_lgpo.py on lines 7686..7692

                                                                                                                                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 144.

                                                                                                                                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

                                                                                                                                            if policy_name in _policydata.policies[p_class]['policies']:
                                                                                                                                                _pol = _policydata.policies[p_class]['policies'][policy_name]
                                                                                                                                            else:
                                                                                                                                                for policy in _policydata.policies[p_class]['policies']:
                                                                                                                                                    if _policydata.policies[p_class]['policies'][policy]['Policy'].upper() == policy_name.upper():
                                                                                                                                Severity: Major
                                                                                                                                Found in salt/modules/win_lgpo.py and 1 other location - About 1 day to fix
                                                                                                                                salt/modules/win_lgpo.py on lines 7954..7961

                                                                                                                                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 144.

                                                                                                                                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

                                                                                                                                            if DISABLED_VALUE_XPATH(admx_policy) and this_policy_setting == 'Not Configured':
                                                                                                                                                # some policies have a disabled list but not an enabled list
                                                                                                                                                # added this to address those issues
                                                                                                                                                if ENABLED_LIST_XPATH(admx_policy) or ENABLED_VALUE_XPATH(admx_policy):
                                                                                                                                                    element_only_enabled_disabled = False
                                                                                                                                Severity: Major
                                                                                                                                Found in salt/modules/win_lgpo.py and 1 other location - About 6 hrs to fix
                                                                                                                                salt/modules/win_lgpo.py on lines 6171..6187

                                                                                                                                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 112.

                                                                                                                                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

                                                                                                                                            if ENABLED_VALUE_XPATH(admx_policy) and this_policy_setting == 'Not Configured':
                                                                                                                                                # some policies have a disabled list but not an enabled list
                                                                                                                                                # added this to address those issues
                                                                                                                                                if DISABLED_LIST_XPATH(admx_policy) or DISABLED_VALUE_XPATH(admx_policy):
                                                                                                                                                    element_only_enabled_disabled = False
                                                                                                                                Severity: Major
                                                                                                                                Found in salt/modules/win_lgpo.py and 1 other location - About 6 hrs to fix
                                                                                                                                salt/modules/win_lgpo.py on lines 6188..6204

                                                                                                                                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 112.

                                                                                                                                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

                                                                                                                                            if ENABLED_LIST_XPATH(admx_policy) and this_policy_setting == 'Not Configured':
                                                                                                                                                if DISABLED_LIST_XPATH(admx_policy) or DISABLED_VALUE_XPATH(admx_policy):
                                                                                                                                                    element_only_enabled_disabled = False
                                                                                                                                                    explicit_enable_disable_value_setting = True
                                                                                                                                                if _checkListItem(admx_policy, this_policyname, this_key, ENABLED_LIST_XPATH, policy_file_data):
                                                                                                                                Severity: Major
                                                                                                                                Found in salt/modules/win_lgpo.py and 1 other location - About 6 hrs to fix
                                                                                                                                salt/modules/win_lgpo.py on lines 6215..6224

                                                                                                                                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

                                                                                                                                            if DISABLED_LIST_XPATH(admx_policy) and this_policy_setting == 'Not Configured':
                                                                                                                                                if ENABLED_LIST_XPATH(admx_policy) or ENABLED_VALUE_XPATH(admx_policy):
                                                                                                                                                    element_only_enabled_disabled = False
                                                                                                                                                    explicit_enable_disable_value_setting = True
                                                                                                                                                if _checkListItem(admx_policy, this_policyname, this_key, DISABLED_LIST_XPATH, policy_file_data):
                                                                                                                                Severity: Major
                                                                                                                                Found in salt/modules/win_lgpo.py and 1 other location - About 6 hrs to fix
                                                                                                                                salt/modules/win_lgpo.py on lines 6205..6214

                                                                                                                                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

                                                                                                                                        expected_string = b''.join(['['.encode('utf-16-le'),
                                                                                                                                                                    reg_key,
                                                                                                                                                                    encoded_null,
                                                                                                                                                                    encoded_semicolon,
                                                                                                                                                                    '**del.'.encode('utf-16-le'),
                                                                                                                                Severity: Major
                                                                                                                                Found in salt/modules/win_lgpo.py and 1 other location - About 5 hrs to fix
                                                                                                                                salt/modules/win_lgpo.py on lines 6045..6061

                                                                                                                                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 101.

                                                                                                                                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

                                                                                                                                                if element.attrib['additive'].lower() == 'false':
                                                                                                                                                    # a delete values will be added before all the other
                                                                                                                                                    # value = data pairs
                                                                                                                                                    del_keys = b''.join(['['.encode('utf-16-le'),
                                                                                                                                                                         reg_key,
                                                                                                                                Severity: Major
                                                                                                                                Found in salt/modules/win_lgpo.py and 1 other location - About 5 hrs to fix
                                                                                                                                salt/modules/win_lgpo.py on lines 5971..6013

                                                                                                                                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 100.

                                                                                                                                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

                                                                                                                                            if not check_deleted:
                                                                                                                                                if this_element_value is not None:
                                                                                                                                                    log.debug('_processValueItem has an explicit '
                                                                                                                                                              'element_value of %s', this_element_value)
                                                                                                                                                    expected_string = del_keys
                                                                                                                                Severity: Major
                                                                                                                                Found in salt/modules/win_lgpo.py and 1 other location - About 5 hrs to fix
                                                                                                                                salt/modules/win_lgpo.py on lines 5936..5952

                                                                                                                                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 100.

                                                                                                                                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

                                                                                                                                                            _ret = __utils__['reg.read_value'](
                                                                                                                                                                    _regedits[regedit]['policy']['Registry']['Hive'],
                                                                                                                                                                    _regedits[regedit]['policy']['Registry']['Path'],
                                                                                                                                                                    _regedits[regedit]['policy']['Registry']['Value'])
                                                                                                                                Severity: Major
                                                                                                                                Found in salt/modules/win_lgpo.py and 1 other location - About 4 hrs to fix
                                                                                                                                salt/modules/win_lgpo.py on lines 8142..8146

                                                                                                                                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 89.

                                                                                                                                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

                                                                                                                                                            if _ret['success'] and _ret['vdata'] != '(value not set)':
                                                                                                                                                                _ret = __utils__['reg.delete_value'](
                                                                                                                                                                        _regedits[regedit]['policy']['Registry']['Hive'],
                                                                                                                                                                        _regedits[regedit]['policy']['Registry']['Path'],
                                                                                                                                                                        _regedits[regedit]['policy']['Registry']['Value'])
                                                                                                                                Severity: Major
                                                                                                                                Found in salt/modules/win_lgpo.py and 1 other location - About 4 hrs to fix
                                                                                                                                salt/modules/win_lgpo.py on lines 8138..8141

                                                                                                                                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 89.

                                                                                                                                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

                                                                                                                                    if etree.QName(element).localname == 'decimal' and etree.QName(parent_element).localname != 'elements':
                                                                                                                                        this_vtype = 'REG_DWORD'
                                                                                                                                        if 'value' in element.attrib:
                                                                                                                                            this_element_value = struct.pack(b'I', int(element.attrib['value']))
                                                                                                                                        else:
                                                                                                                                Severity: Major
                                                                                                                                Found in salt/modules/win_lgpo.py and 1 other location - About 3 hrs to fix
                                                                                                                                salt/modules/win_lgpo.py on lines 5860..5874

                                                                                                                                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 79.

                                                                                                                                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

                                                                                                                                    elif etree.QName(element).localname == 'longDecimal' and etree.QName(parent_element).localname != 'elements':
                                                                                                                                        # WARNING: no longDecimals in current ADMX files included with 2012
                                                                                                                                        # server, so untested/assumed
                                                                                                                                        this_vtype = 'REG_QWORD'
                                                                                                                                        if 'value' in element.attrib:
                                                                                                                                Severity: Major
                                                                                                                                Found in salt/modules/win_lgpo.py and 1 other location - About 3 hrs to fix
                                                                                                                                salt/modules/win_lgpo.py on lines 5847..5859

                                                                                                                                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 79.

                                                                                                                                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 'storeAsText' in element.attrib:
                                                                                                                                                if element.attrib['storeAsText'].lower() == 'true':
                                                                                                                                                    this_vtype = 'REG_SZ'
                                                                                                                                                    if requested_val is not None:
                                                                                                                                                        this_element_value = six.text_type(requested_val).encode('utf-16-le')
                                                                                                                                Severity: Major
                                                                                                                                Found in salt/modules/win_lgpo.py and 1 other location - About 3 hrs to fix
                                                                                                                                salt/modules/win_lgpo.py on lines 5897..5901

                                                                                                                                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 66.

                                                                                                                                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 'storeAsText' in element.attrib:
                                                                                                                                                if element.attrib['storeAsText'].lower() == 'true':
                                                                                                                                                    this_vtype = 'REG_SZ'
                                                                                                                                                    if requested_val is not None:
                                                                                                                                                        this_element_value = six.text_type(requested_val).encode('utf-16-le')
                                                                                                                                Severity: Major
                                                                                                                                Found in salt/modules/win_lgpo.py and 1 other location - About 3 hrs to fix
                                                                                                                                salt/modules/win_lgpo.py on lines 5910..5914

                                                                                                                                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 66.

                                                                                                                                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

                                                                                                                                    if check_deleted:
                                                                                                                                        reg_vtype = 'REG_SZ'
                                                                                                                                        expected_string = b''.join(['['.encode('utf-16-le'),
                                                                                                                                                                    reg_key,
                                                                                                                                                                    encoded_null,
                                                                                                                                Severity: Major
                                                                                                                                Found in salt/modules/win_lgpo.py and 2 other locations - About 3 hrs to fix
                                                                                                                                salt/modules/win_lgpo.py on lines 6019..6032
                                                                                                                                salt/modules/win_lgpo.py on lines 6045..6075

                                                                                                                                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 71.

                                                                                                                                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

                                                                                                                                            if this_element_value is not None:
                                                                                                                                                expected_string = b''.join(['['.encode('utf-16-le'),
                                                                                                                                                                            reg_key,
                                                                                                                                                                            encoded_null,
                                                                                                                                                                            encoded_semicolon,
                                                                                                                                Severity: Major
                                                                                                                                Found in salt/modules/win_lgpo.py and 2 other locations - About 3 hrs to fix
                                                                                                                                salt/modules/win_lgpo.py on lines 5783..5813
                                                                                                                                salt/modules/win_lgpo.py on lines 6045..6075

                                                                                                                                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 71.

                                                                                                                                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

                                                                                                                                        if etree.QName(element).localname == "delete" or check_deleted:
                                                                                                                                            # delete value
                                                                                                                                            expected_string = b''.join(['['.encode('utf-16-le'),
                                                                                                                                                                        reg_key,
                                                                                                                                                                        encoded_null,
                                                                                                                                Severity: Major
                                                                                                                                Found in salt/modules/win_lgpo.py and 2 other locations - About 3 hrs to fix
                                                                                                                                salt/modules/win_lgpo.py on lines 5783..5813
                                                                                                                                salt/modules/win_lgpo.py on lines 6019..6032

                                                                                                                                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 71.

                                                                                                                                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 acct in _lsarights[lsaright]['value']:
                                                                                                                                                                _ret = _addAccountRights(acct, _lsarights[lsaright]['policy']['LsaRights']['Option'])
                                                                                                                                                                if not _ret:
                                                                                                                                                                    msg = 'An error occurred attempting to configure the user right {0}.'
                                                                                                                                                                    raise SaltInvocationError(msg.format(lsaright))
                                                                                                                                Severity: Major
                                                                                                                                Found in salt/modules/win_lgpo.py and 1 other location - About 2 hrs to fix
                                                                                                                                salt/modules/win_lgpo.py on lines 8165..8171

                                                                                                                                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 61.

                                                                                                                                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

                                                                                                                                                                if acct not in _lsarights[lsaright]['value']:
                                                                                                                                                                    _ret = _delAccountRights(
                                                                                                                                                                            acct, _lsarights[lsaright]['policy']['LsaRights']['Option'])
                                                                                                                                                                    if not _ret:
                                                                                                                                                                        msg = ('An error occurred attempting to remove previously'
                                                                                                                                Severity: Major
                                                                                                                                Found in salt/modules/win_lgpo.py and 1 other location - About 2 hrs to fix
                                                                                                                                salt/modules/win_lgpo.py on lines 8158..8162

                                                                                                                                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 61.

                                                                                                                                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 data_to_replace:
                                                                                                                                            log.debug('replacing %s with %s', data_to_replace, this_string)
                                                                                                                                            policy_data = policy_data.replace(data_to_replace, this_string)
                                                                                                                                        else:
                                                                                                                                            log.debug('appending %s', this_string)
                                                                                                                                Severity: Major
                                                                                                                                Found in salt/modules/win_lgpo.py and 1 other location - About 2 hrs to fix
                                                                                                                                salt/modules/win_lgpo.py on lines 6799..6804

                                                                                                                                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 52.

                                                                                                                                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 data_to_replace:
                                                                                                                                        log.debug('replacing %s with %s', data_to_replace, this_string)
                                                                                                                                        policy_data = policy_data.replace(data_to_replace, this_string)
                                                                                                                                    else:
                                                                                                                                        log.debug('appending %s', this_string)
                                                                                                                                Severity: Major
                                                                                                                                Found in salt/modules/win_lgpo.py and 1 other location - About 2 hrs to fix
                                                                                                                                salt/modules/win_lgpo.py on lines 6770..6775

                                                                                                                                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 52.

                                                                                                                                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 userSid[1]:
                                                                                                                                                    userSid = '{1}\\{0}'.format(userSid[0], userSid[1])
                                                                                                                                                else:
                                                                                                                                                    userSid = '{0}'.format(userSid[0])
                                                                                                                                Severity: Major
                                                                                                                                Found in salt/modules/win_lgpo.py and 1 other location - About 2 hrs to fix
                                                                                                                                salt/modules/win_dacl.py on lines 551..554

                                                                                                                                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 52.

                                                                                                                                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 16 locations. Consider refactoring.
                                                                                                                                Open

                                                                                                                                                    'LmCompatibilityLevel': {
                                                                                                                                                        'Policy': 'Network security: LAN Manager authentication level',
                                                                                                                                                        'Settings': self.lm_compat_levels.keys(),
                                                                                                                                                        'lgpo_section': self.security_options_gpedit_path,
                                                                                                                                                        'Registry': {
                                                                                                                                Severity: Major
                                                                                                                                Found in salt/modules/win_lgpo.py and 15 other locations - About 1 hr to fix
                                                                                                                                salt/modules/win_lgpo.py on lines 1729..1749
                                                                                                                                salt/modules/win_lgpo.py on lines 1875..1896
                                                                                                                                salt/modules/win_lgpo.py on lines 1943..1965
                                                                                                                                salt/modules/win_lgpo.py on lines 1969..1990
                                                                                                                                salt/modules/win_lgpo.py on lines 2157..2178
                                                                                                                                salt/modules/win_lgpo.py on lines 2253..2274
                                                                                                                                salt/modules/win_lgpo.py on lines 2320..2341
                                                                                                                                salt/modules/win_lgpo.py on lines 2478..2499
                                                                                                                                salt/modules/win_lgpo.py on lines 3852..3872
                                                                                                                                salt/modules/win_lgpo.py on lines 4028..4047
                                                                                                                                salt/modules/win_lgpo.py on lines 4127..4146
                                                                                                                                salt/modules/win_lgpo.py on lines 4150..4170
                                                                                                                                salt/modules/win_lgpo.py on lines 4174..4194
                                                                                                                                salt/modules/win_lgpo.py on lines 4198..4218
                                                                                                                                salt/modules/win_lgpo.py on lines 4222..4242

                                                                                                                                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 57.

                                                                                                                                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 16 locations. Consider refactoring.
                                                                                                                                Open

                                                                                                                                                    'ConsentPromptBehaviorUser': {
                                                                                                                                                        'Policy': 'User Account Control: Behavior of the '
                                                                                                                                                                  'elevation prompt for standard users',
                                                                                                                                                        'Settings': self.uac_user_prompt_lookup.keys(),
                                                                                                                                                        'lgpo_section': self.security_options_gpedit_path,
                                                                                                                                Severity: Major
                                                                                                                                Found in salt/modules/win_lgpo.py and 15 other locations - About 1 hr to fix
                                                                                                                                salt/modules/win_lgpo.py on lines 1729..1749
                                                                                                                                salt/modules/win_lgpo.py on lines 1875..1896
                                                                                                                                salt/modules/win_lgpo.py on lines 1943..1965
                                                                                                                                salt/modules/win_lgpo.py on lines 2157..2178
                                                                                                                                salt/modules/win_lgpo.py on lines 2253..2274
                                                                                                                                salt/modules/win_lgpo.py on lines 2320..2341
                                                                                                                                salt/modules/win_lgpo.py on lines 2478..2499
                                                                                                                                salt/modules/win_lgpo.py on lines 3852..3872
                                                                                                                                salt/modules/win_lgpo.py on lines 4005..4024
                                                                                                                                salt/modules/win_lgpo.py on lines 4028..4047
                                                                                                                                salt/modules/win_lgpo.py on lines 4127..4146
                                                                                                                                salt/modules/win_lgpo.py on lines 4150..4170
                                                                                                                                salt/modules/win_lgpo.py on lines 4174..4194
                                                                                                                                salt/modules/win_lgpo.py on lines 4198..4218
                                                                                                                                salt/modules/win_lgpo.py on lines 4222..4242

                                                                                                                                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 57.

                                                                                                                                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 16 locations. Consider refactoring.
                                                                                                                                Open

                                                                                                                                                    'LDAPClientIntegrity': {
                                                                                                                                                        'Policy': 'Network security: LDAP client signing requirements',
                                                                                                                                                        'Settings': self.ldap_signing_reqs.keys(),
                                                                                                                                                        'lgpo_section': self.security_options_gpedit_path,
                                                                                                                                                        'Registry': {
                                                                                                                                Severity: Major
                                                                                                                                Found in salt/modules/win_lgpo.py and 15 other locations - About 1 hr to fix
                                                                                                                                salt/modules/win_lgpo.py on lines 1729..1749
                                                                                                                                salt/modules/win_lgpo.py on lines 1875..1896
                                                                                                                                salt/modules/win_lgpo.py on lines 1943..1965
                                                                                                                                salt/modules/win_lgpo.py on lines 1969..1990
                                                                                                                                salt/modules/win_lgpo.py on lines 2157..2178
                                                                                                                                salt/modules/win_lgpo.py on lines 2253..2274
                                                                                                                                salt/modules/win_lgpo.py on lines 2320..2341
                                                                                                                                salt/modules/win_lgpo.py on lines 2478..2499
                                                                                                                                salt/modules/win_lgpo.py on lines 3852..3872
                                                                                                                                salt/modules/win_lgpo.py on lines 4005..4024
                                                                                                                                salt/modules/win_lgpo.py on lines 4127..4146
                                                                                                                                salt/modules/win_lgpo.py on lines 4150..4170
                                                                                                                                salt/modules/win_lgpo.py on lines 4174..4194
                                                                                                                                salt/modules/win_lgpo.py on lines 4198..4218
                                                                                                                                salt/modules/win_lgpo.py on lines 4222..4242

                                                                                                                                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 57.

                                                                                                                                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 16 locations. Consider refactoring.
                                                                                                                                Open

                                                                                                                                                    'RestrictReceivingNTLMTraffic': {
                                                                                                                                                        'Policy': 'Network security: Restrict NTLM: Incoming'
                                                                                                                                                                  ' NTLM traffic',
                                                                                                                                                        'Settings': self.incoming_ntlm_settings.keys(),
                                                                                                                                                        'lgpo_section': self.security_options_gpedit_path,
                                                                                                                                Severity: Major
                                                                                                                                Found in salt/modules/win_lgpo.py and 15 other locations - About 1 hr to fix
                                                                                                                                salt/modules/win_lgpo.py on lines 1729..1749
                                                                                                                                salt/modules/win_lgpo.py on lines 1875..1896
                                                                                                                                salt/modules/win_lgpo.py on lines 1943..1965
                                                                                                                                salt/modules/win_lgpo.py on lines 1969..1990
                                                                                                                                salt/modules/win_lgpo.py on lines 2157..2178
                                                                                                                                salt/modules/win_lgpo.py on lines 2253..2274
                                                                                                                                salt/modules/win_lgpo.py on lines 2320..2341
                                                                                                                                salt/modules/win_lgpo.py on lines 2478..2499
                                                                                                                                salt/modules/win_lgpo.py on lines 3852..3872
                                                                                                                                salt/modules/win_lgpo.py on lines 4005..4024
                                                                                                                                salt/modules/win_lgpo.py on lines 4028..4047
                                                                                                                                salt/modules/win_lgpo.py on lines 4127..4146
                                                                                                                                salt/modules/win_lgpo.py on lines 4150..4170
                                                                                                                                salt/modules/win_lgpo.py on lines 4198..4218
                                                                                                                                salt/modules/win_lgpo.py on lines 4222..4242

                                                                                                                                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 57.

                                                                                                                                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 16 locations. Consider refactoring.
                                                                                                                                Open

                                                                                                                                                    'ScRemoveOption': {
                                                                                                                                                        'Policy': 'Interactive logon: Smart card removal '
                                                                                                                                                                  'behavior',
                                                                                                                                                        'Settings': self.sc_removal_lookup.keys(),
                                                                                                                                                        'lgpo_section': self.security_options_gpedit_path,
                                                                                                                                Severity: Major
                                                                                                                                Found in salt/modules/win_lgpo.py and 15 other locations - About 1 hr to fix
                                                                                                                                salt/modules/win_lgpo.py on lines 1729..1749
                                                                                                                                salt/modules/win_lgpo.py on lines 1943..1965
                                                                                                                                salt/modules/win_lgpo.py on lines 1969..1990
                                                                                                                                salt/modules/win_lgpo.py on lines 2157..2178
                                                                                                                                salt/modules/win_lgpo.py on lines 2253..2274
                                                                                                                                salt/modules/win_lgpo.py on lines 2320..2341
                                                                                                                                salt/modules/win_lgpo.py on lines 2478..2499
                                                                                                                                salt/modules/win_lgpo.py on lines 3852..3872
                                                                                                                                salt/modules/win_lgpo.py on lines 4005..4024
                                                                                                                                salt/modules/win_lgpo.py on lines 4028..4047
                                                                                                                                salt/modules/win_lgpo.py on lines 4127..4146
                                                                                                                                salt/modules/win_lgpo.py on lines 4150..4170
                                                                                                                                salt/modules/win_lgpo.py on lines 4174..4194
                                                                                                                                salt/modules/win_lgpo.py on lines 4198..4218
                                                                                                                                salt/modules/win_lgpo.py on lines 4222..4242

                                                                                                                                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 57.

                                                                                                                                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 16 locations. Consider refactoring.
                                                                                                                                Open

                                                                                                                                                    'EnableS4U2SelfForClaims': {
                                                                                                                                                        'Policy': 'Microsoft network server: Attempt S4U2Self '
                                                                                                                                                                  'to obtain claim information',
                                                                                                                                                        'Settings': self.s4u2self_options.keys(),
                                                                                                                                                        'lgpo_section': self.security_options_gpedit_path,
                                                                                                                                Severity: Major
                                                                                                                                Found in salt/modules/win_lgpo.py and 15 other locations - About 1 hr to fix
                                                                                                                                salt/modules/win_lgpo.py on lines 1729..1749
                                                                                                                                salt/modules/win_lgpo.py on lines 1875..1896
                                                                                                                                salt/modules/win_lgpo.py on lines 1943..1965
                                                                                                                                salt/modules/win_lgpo.py on lines 1969..1990
                                                                                                                                salt/modules/win_lgpo.py on lines 2157..2178
                                                                                                                                salt/modules/win_lgpo.py on lines 2320..2341
                                                                                                                                salt/modules/win_lgpo.py on lines 2478..2499
                                                                                                                                salt/modules/win_lgpo.py on lines 3852..3872
                                                                                                                                salt/modules/win_lgpo.py on lines 4005..4024
                                                                                                                                salt/modules/win_lgpo.py on lines 4028..4047
                                                                                                                                salt/modules/win_lgpo.py on lines 4127..4146
                                                                                                                                salt/modules/win_lgpo.py on lines 4150..4170
                                                                                                                                salt/modules/win_lgpo.py on lines 4174..4194
                                                                                                                                salt/modules/win_lgpo.py on lines 4198..4218
                                                                                                                                salt/modules/win_lgpo.py on lines 4222..4242

                                                                                                                                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 57.

                                                                                                                                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 16 locations. Consider refactoring.
                                                                                                                                Open

                                                                                                                                                    'SmbServerNameHardeningLevel': {
                                                                                                                                                        'Policy': 'Microsoft network server: Server SPN target '
                                                                                                                                                                  'name validation level',
                                                                                                                                                        'Settings': self.smb_server_name_hardening_levels.keys(),
                                                                                                                                                        'lgpo_section': self.security_options_gpedit_path,
                                                                                                                                Severity: Major
                                                                                                                                Found in salt/modules/win_lgpo.py and 15 other locations - About 1 hr to fix
                                                                                                                                salt/modules/win_lgpo.py on lines 1729..1749
                                                                                                                                salt/modules/win_lgpo.py on lines 1875..1896
                                                                                                                                salt/modules/win_lgpo.py on lines 1943..1965
                                                                                                                                salt/modules/win_lgpo.py on lines 1969..1990
                                                                                                                                salt/modules/win_lgpo.py on lines 2157..2178
                                                                                                                                salt/modules/win_lgpo.py on lines 2253..2274
                                                                                                                                salt/modules/win_lgpo.py on lines 2478..2499
                                                                                                                                salt/modules/win_lgpo.py on lines 3852..3872
                                                                                                                                salt/modules/win_lgpo.py on lines 4005..4024
                                                                                                                                salt/modules/win_lgpo.py on lines 4028..4047
                                                                                                                                salt/modules/win_lgpo.py on lines 4127..4146
                                                                                                                                salt/modules/win_lgpo.py on lines 4150..4170
                                                                                                                                salt/modules/win_lgpo.py on lines 4174..4194
                                                                                                                                salt/modules/win_lgpo.py on lines 4198..4218
                                                                                                                                salt/modules/win_lgpo.py on lines 4222..4242

                                                                                                                                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 57.

                                                                                                                                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 16 locations. Consider refactoring.
                                                                                                                                Open

                                                                                                                                                    'AuditNTLMInDomain': {
                                                                                                                                                        'Policy': 'Network security: Restrict NTLM: Audit NTLM '
                                                                                                                                                                  'authentication in this domain',
                                                                                                                                                        'Settings': self.ntlm_domain_audit_settings.keys(),
                                                                                                                                                        'lgpo_section': self.security_options_gpedit_path,
                                                                                                                                Severity: Major
                                                                                                                                Found in salt/modules/win_lgpo.py and 15 other locations - About 1 hr to fix
                                                                                                                                salt/modules/win_lgpo.py on lines 1729..1749
                                                                                                                                salt/modules/win_lgpo.py on lines 1875..1896
                                                                                                                                salt/modules/win_lgpo.py on lines 1943..1965
                                                                                                                                salt/modules/win_lgpo.py on lines 1969..1990
                                                                                                                                salt/modules/win_lgpo.py on lines 2157..2178
                                                                                                                                salt/modules/win_lgpo.py on lines 2253..2274
                                                                                                                                salt/modules/win_lgpo.py on lines 2320..2341
                                                                                                                                salt/modules/win_lgpo.py on lines 2478..2499
                                                                                                                                salt/modules/win_lgpo.py on lines 3852..3872
                                                                                                                                salt/modules/win_lgpo.py on lines 4005..4024
                                                                                                                                salt/modules/win_lgpo.py on lines 4028..4047
                                                                                                                                salt/modules/win_lgpo.py on lines 4127..4146
                                                                                                                                salt/modules/win_lgpo.py on lines 4174..4194
                                                                                                                                salt/modules/win_lgpo.py on lines 4198..4218
                                                                                                                                salt/modules/win_lgpo.py on lines 4222..4242

                                                                                                                                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 57.

                                                                                                                                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 16 locations. Consider refactoring.
                                                                                                                                Open

                                                                                                                                                    'LDAPServerIntegrity': {
                                                                                                                                                        'Policy': 'Domain controller: LDAP server signing '
                                                                                                                                                                  'requirements',
                                                                                                                                                        'Settings': self.ldap_server_signing_requirements.keys(),
                                                                                                                                                        'lgpo_section': self.security_options_gpedit_path,
                                                                                                                                Severity: Major
                                                                                                                                Found in salt/modules/win_lgpo.py and 15 other locations - About 1 hr to fix
                                                                                                                                salt/modules/win_lgpo.py on lines 1729..1749
                                                                                                                                salt/modules/win_lgpo.py on lines 1875..1896
                                                                                                                                salt/modules/win_lgpo.py on lines 1943..1965
                                                                                                                                salt/modules/win_lgpo.py on lines 1969..1990
                                                                                                                                salt/modules/win_lgpo.py on lines 2157..2178
                                                                                                                                salt/modules/win_lgpo.py on lines 2253..2274
                                                                                                                                salt/modules/win_lgpo.py on lines 2320..2341
                                                                                                                                salt/modules/win_lgpo.py on lines 3852..3872
                                                                                                                                salt/modules/win_lgpo.py on lines 4005..4024
                                                                                                                                salt/modules/win_lgpo.py on lines 4028..4047
                                                                                                                                salt/modules/win_lgpo.py on lines 4127..4146
                                                                                                                                salt/modules/win_lgpo.py on lines 4150..4170
                                                                                                                                salt/modules/win_lgpo.py on lines 4174..4194
                                                                                                                                salt/modules/win_lgpo.py on lines 4198..4218
                                                                                                                                salt/modules/win_lgpo.py on lines 4222..4242

                                                                                                                                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 57.

                                                                                                                                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 16 locations. Consider refactoring.
                                                                                                                                Open

                                                                                                                                                    'AuditReceivingNTLMTraffic': {
                                                                                                                                                        'Policy': 'Network security: Restrict NTLM: Audit Incoming NTLM Traffic',
                                                                                                                                                        'Settings': self.ntlm_audit_settings.keys(),
                                                                                                                                                        'lgpo_section': self.security_options_gpedit_path,
                                                                                                                                                        'Registry': {
                                                                                                                                Severity: Major
                                                                                                                                Found in salt/modules/win_lgpo.py and 15 other locations - About 1 hr to fix
                                                                                                                                salt/modules/win_lgpo.py on lines 1729..1749
                                                                                                                                salt/modules/win_lgpo.py on lines 1875..1896
                                                                                                                                salt/modules/win_lgpo.py on lines 1943..1965
                                                                                                                                salt/modules/win_lgpo.py on lines 1969..1990
                                                                                                                                salt/modules/win_lgpo.py on lines 2157..2178
                                                                                                                                salt/modules/win_lgpo.py on lines 2253..2274
                                                                                                                                salt/modules/win_lgpo.py on lines 2320..2341
                                                                                                                                salt/modules/win_lgpo.py on lines 2478..2499
                                                                                                                                salt/modules/win_lgpo.py on lines 3852..3872
                                                                                                                                salt/modules/win_lgpo.py on lines 4005..4024
                                                                                                                                salt/modules/win_lgpo.py on lines 4028..4047
                                                                                                                                salt/modules/win_lgpo.py on lines 4150..4170
                                                                                                                                salt/modules/win_lgpo.py on lines 4174..4194
                                                                                                                                salt/modules/win_lgpo.py on lines 4198..4218
                                                                                                                                salt/modules/win_lgpo.py on lines 4222..4242

                                                                                                                                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 57.

                                                                                                                                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 16 locations. Consider refactoring.
                                                                                                                                Open

                                                                                                                                                    'NoConnectedUser': {
                                                                                                                                                        'Policy': 'Accounts: Block Microsoft accounts',
                                                                                                                                                        'Settings': self.block_ms_accounts.keys(),
                                                                                                                                                        'lgpo_section': self.security_options_gpedit_path,
                                                                                                                                                        'Registry': {
                                                                                                                                Severity: Major
                                                                                                                                Found in salt/modules/win_lgpo.py and 15 other locations - About 1 hr to fix
                                                                                                                                salt/modules/win_lgpo.py on lines 1875..1896
                                                                                                                                salt/modules/win_lgpo.py on lines 1943..1965
                                                                                                                                salt/modules/win_lgpo.py on lines 1969..1990
                                                                                                                                salt/modules/win_lgpo.py on lines 2157..2178
                                                                                                                                salt/modules/win_lgpo.py on lines 2253..2274
                                                                                                                                salt/modules/win_lgpo.py on lines 2320..2341
                                                                                                                                salt/modules/win_lgpo.py on lines 2478..2499
                                                                                                                                salt/modules/win_lgpo.py on lines 3852..3872
                                                                                                                                salt/modules/win_lgpo.py on lines 4005..4024
                                                                                                                                salt/modules/win_lgpo.py on lines 4028..4047
                                                                                                                                salt/modules/win_lgpo.py on lines 4127..4146
                                                                                                                                salt/modules/win_lgpo.py on lines 4150..4170
                                                                                                                                salt/modules/win_lgpo.py on lines 4174..4194
                                                                                                                                salt/modules/win_lgpo.py on lines 4198..4218
                                                                                                                                salt/modules/win_lgpo.py on lines 4222..4242

                                                                                                                                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 57.

                                                                                                                                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 16 locations. Consider refactoring.
                                                                                                                                Open

                                                                                                                                                    'ForceKeyProtection': {
                                                                                                                                                        'Policy': 'System Cryptography: Force strong key protection for '
                                                                                                                                                                  'user keys stored on the computer',
                                                                                                                                                        'Settings': self.force_key_protection.keys(),
                                                                                                                                                        'lgpo_section': self.security_options_gpedit_path,
                                                                                                                                Severity: Major
                                                                                                                                Found in salt/modules/win_lgpo.py and 15 other locations - About 1 hr to fix
                                                                                                                                salt/modules/win_lgpo.py on lines 1729..1749
                                                                                                                                salt/modules/win_lgpo.py on lines 1875..1896
                                                                                                                                salt/modules/win_lgpo.py on lines 1943..1965
                                                                                                                                salt/modules/win_lgpo.py on lines 1969..1990
                                                                                                                                salt/modules/win_lgpo.py on lines 2157..2178
                                                                                                                                salt/modules/win_lgpo.py on lines 2253..2274
                                                                                                                                salt/modules/win_lgpo.py on lines 2320..2341
                                                                                                                                salt/modules/win_lgpo.py on lines 2478..2499
                                                                                                                                salt/modules/win_lgpo.py on lines 4005..4024
                                                                                                                                salt/modules/win_lgpo.py on lines 4028..4047
                                                                                                                                salt/modules/win_lgpo.py on lines 4127..4146
                                                                                                                                salt/modules/win_lgpo.py on lines 4150..4170
                                                                                                                                salt/modules/win_lgpo.py on lines 4174..4194
                                                                                                                                salt/modules/win_lgpo.py on lines 4198..4218
                                                                                                                                salt/modules/win_lgpo.py on lines 4222..4242

                                                                                                                                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 57.

                                                                                                                                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 16 locations. Consider refactoring.
                                                                                                                                Open

                                                                                                                                                    'RestrictNTLMInDomain': {
                                                                                                                                                        'Policy': 'Network security: Restrict NTLM: NTLM '
                                                                                                                                                                  'authentication in this domain',
                                                                                                                                                        'Settings': self.ntlm_domain_auth_settings.keys(),
                                                                                                                                                        'lgpo_section': self.security_options_gpedit_path,
                                                                                                                                Severity: Major
                                                                                                                                Found in salt/modules/win_lgpo.py and 15 other locations - About 1 hr to fix
                                                                                                                                salt/modules/win_lgpo.py on lines 1729..1749
                                                                                                                                salt/modules/win_lgpo.py on lines 1875..1896
                                                                                                                                salt/modules/win_lgpo.py on lines 1943..1965
                                                                                                                                salt/modules/win_lgpo.py on lines 1969..1990
                                                                                                                                salt/modules/win_lgpo.py on lines 2157..2178
                                                                                                                                salt/modules/win_lgpo.py on lines 2253..2274
                                                                                                                                salt/modules/win_lgpo.py on lines 2320..2341
                                                                                                                                salt/modules/win_lgpo.py on lines 2478..2499
                                                                                                                                salt/modules/win_lgpo.py on lines 3852..3872
                                                                                                                                salt/modules/win_lgpo.py on lines 4005..4024
                                                                                                                                salt/modules/win_lgpo.py on lines 4028..4047
                                                                                                                                salt/modules/win_lgpo.py on lines 4127..4146
                                                                                                                                salt/modules/win_lgpo.py on lines 4150..4170
                                                                                                                                salt/modules/win_lgpo.py on lines 4174..4194
                                                                                                                                salt/modules/win_lgpo.py on lines 4222..4242

                                                                                                                                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 57.

                                                                                                                                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 16 locations. Consider refactoring.
                                                                                                                                Open

                                                                                                                                                    'ConsentPromptBehaviorAdmin': {
                                                                                                                                                        'Policy': 'User Account Control: Behavior of the '
                                                                                                                                                                  'elevation prompt for administrators in '
                                                                                                                                                                  'Admin Approval Mode',
                                                                                                                                                        'Settings': self.uac_admin_prompt_lookup.keys(),
                                                                                                                                Severity: Major
                                                                                                                                Found in salt/modules/win_lgpo.py and 15 other locations - About 1 hr to fix
                                                                                                                                salt/modules/win_lgpo.py on lines 1729..1749
                                                                                                                                salt/modules/win_lgpo.py on lines 1875..1896
                                                                                                                                salt/modules/win_lgpo.py on lines 1969..1990
                                                                                                                                salt/modules/win_lgpo.py on lines 2157..2178
                                                                                                                                salt/modules/win_lgpo.py on lines 2253..2274
                                                                                                                                salt/modules/win_lgpo.py on lines 2320..2341
                                                                                                                                salt/modules/win_lgpo.py on lines 2478..2499
                                                                                                                                salt/modules/win_lgpo.py on lines 3852..3872
                                                                                                                                salt/modules/win_lgpo.py on lines 4005..4024
                                                                                                                                salt/modules/win_lgpo.py on lines 4028..4047
                                                                                                                                salt/modules/win_lgpo.py on lines 4127..4146
                                                                                                                                salt/modules/win_lgpo.py on lines 4150..4170
                                                                                                                                salt/modules/win_lgpo.py on lines 4174..4194
                                                                                                                                salt/modules/win_lgpo.py on lines 4198..4218
                                                                                                                                salt/modules/win_lgpo.py on lines 4222..4242

                                                                                                                                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 57.

                                                                                                                                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 16 locations. Consider refactoring.
                                                                                                                                Open

                                                                                                                                                    'RestrictSendingNTLMTraffic': {
                                                                                                                                                        'Policy': 'Network security: Restrict NTLM: Outgoing NTLM'
                                                                                                                                                                  ' traffic to remote servers',
                                                                                                                                                        'Settings': self.outgoing_ntlm_settings.keys(),
                                                                                                                                                        'lgpo_section': self.security_options_gpedit_path,
                                                                                                                                Severity: Major
                                                                                                                                Found in salt/modules/win_lgpo.py and 15 other locations - About 1 hr to fix
                                                                                                                                salt/modules/win_lgpo.py on lines 1729..1749
                                                                                                                                salt/modules/win_lgpo.py on lines 1875..1896
                                                                                                                                salt/modules/win_lgpo.py on lines 1943..1965
                                                                                                                                salt/modules/win_lgpo.py on lines 1969..1990
                                                                                                                                salt/modules/win_lgpo.py on lines 2157..2178
                                                                                                                                salt/modules/win_lgpo.py on lines 2253..2274
                                                                                                                                salt/modules/win_lgpo.py on lines 2320..2341
                                                                                                                                salt/modules/win_lgpo.py on lines 2478..2499
                                                                                                                                salt/modules/win_lgpo.py on lines 3852..3872
                                                                                                                                salt/modules/win_lgpo.py on lines 4005..4024
                                                                                                                                salt/modules/win_lgpo.py on lines 4028..4047
                                                                                                                                salt/modules/win_lgpo.py on lines 4127..4146
                                                                                                                                salt/modules/win_lgpo.py on lines 4150..4170
                                                                                                                                salt/modules/win_lgpo.py on lines 4174..4194
                                                                                                                                salt/modules/win_lgpo.py on lines 4198..4218

                                                                                                                                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 57.

                                                                                                                                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 16 locations. Consider refactoring.
                                                                                                                                Open

                                                                                                                                                    'DontDisplayLockedUserId': {
                                                                                                                                                        'Policy': 'Interactive logon: Display user information '
                                                                                                                                                                  'when the session is locked',
                                                                                                                                                        'Settings': self.locked_session_user_info.keys(),
                                                                                                                                                        'lgpo_section': self.security_options_gpedit_path,
                                                                                                                                Severity: Major
                                                                                                                                Found in salt/modules/win_lgpo.py and 15 other locations - About 1 hr to fix
                                                                                                                                salt/modules/win_lgpo.py on lines 1729..1749
                                                                                                                                salt/modules/win_lgpo.py on lines 1875..1896
                                                                                                                                salt/modules/win_lgpo.py on lines 1943..1965
                                                                                                                                salt/modules/win_lgpo.py on lines 1969..1990
                                                                                                                                salt/modules/win_lgpo.py on lines 2253..2274
                                                                                                                                salt/modules/win_lgpo.py on lines 2320..2341
                                                                                                                                salt/modules/win_lgpo.py on lines 2478..2499
                                                                                                                                salt/modules/win_lgpo.py on lines 3852..3872
                                                                                                                                salt/modules/win_lgpo.py on lines 4005..4024
                                                                                                                                salt/modules/win_lgpo.py on lines 4028..4047
                                                                                                                                salt/modules/win_lgpo.py on lines 4127..4146
                                                                                                                                salt/modules/win_lgpo.py on lines 4150..4170
                                                                                                                                salt/modules/win_lgpo.py on lines 4174..4194
                                                                                                                                salt/modules/win_lgpo.py on lines 4198..4218
                                                                                                                                salt/modules/win_lgpo.py on lines 4222..4242

                                                                                                                                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 57.

                                                                                                                                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 24 locations. Consider refactoring.
                                                                                                                                Open

                                                                                                                                                    'WfwPrivateOutboundConnections': {
                                                                                                                                                        'Policy': 'Network firewall: Private: Outbound connections',
                                                                                                                                                        'lgpo_section': self.windows_firewall_gpedit_path,
                                                                                                                                                        # Settings available are:
                                                                                                                                                        # - Block
                                                                                                                                Severity: Major
                                                                                                                                Found in salt/modules/win_lgpo.py and 23 other locations - About 1 hr to fix
                                                                                                                                salt/modules/win_lgpo.py on lines 928..950
                                                                                                                                salt/modules/win_lgpo.py on lines 954..976
                                                                                                                                salt/modules/win_lgpo.py on lines 980..1002
                                                                                                                                salt/modules/win_lgpo.py on lines 1006..1029
                                                                                                                                salt/modules/win_lgpo.py on lines 1033..1056
                                                                                                                                salt/modules/win_lgpo.py on lines 1060..1083
                                                                                                                                salt/modules/win_lgpo.py on lines 1087..1109
                                                                                                                                salt/modules/win_lgpo.py on lines 1139..1161
                                                                                                                                salt/modules/win_lgpo.py on lines 1165..1187
                                                                                                                                salt/modules/win_lgpo.py on lines 1191..1213
                                                                                                                                salt/modules/win_lgpo.py on lines 1217..1239
                                                                                                                                salt/modules/win_lgpo.py on lines 1243..1266
                                                                                                                                salt/modules/win_lgpo.py on lines 1270..1293
                                                                                                                                salt/modules/win_lgpo.py on lines 1297..1320
                                                                                                                                salt/modules/win_lgpo.py on lines 1324..1347
                                                                                                                                salt/modules/win_lgpo.py on lines 1351..1374
                                                                                                                                salt/modules/win_lgpo.py on lines 1378..1401
                                                                                                                                salt/modules/win_lgpo.py on lines 1483..1505
                                                                                                                                salt/modules/win_lgpo.py on lines 1509..1531
                                                                                                                                salt/modules/win_lgpo.py on lines 1535..1557
                                                                                                                                salt/modules/win_lgpo.py on lines 1561..1583
                                                                                                                                salt/modules/win_lgpo.py on lines 1587..1609
                                                                                                                                salt/modules/win_lgpo.py on lines 1613..1635

                                                                                                                                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 55.

                                                                                                                                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 24 locations. Consider refactoring.
                                                                                                                                Open

                                                                                                                                                    'WfwPublicSettingsLocalFirewallRules': {
                                                                                                                                                        'Policy': 'Network firewall: Public: Settings: Apply '
                                                                                                                                                                  'local firewall rules',
                                                                                                                                                        'lgpo_section': self.windows_firewall_gpedit_path,
                                                                                                                                                        # Settings available are:
                                                                                                                                Severity: Major
                                                                                                                                Found in salt/modules/win_lgpo.py and 23 other locations - About 1 hr to fix
                                                                                                                                salt/modules/win_lgpo.py on lines 928..950
                                                                                                                                salt/modules/win_lgpo.py on lines 954..976
                                                                                                                                salt/modules/win_lgpo.py on lines 980..1002
                                                                                                                                salt/modules/win_lgpo.py on lines 1006..1029
                                                                                                                                salt/modules/win_lgpo.py on lines 1033..1056
                                                                                                                                salt/modules/win_lgpo.py on lines 1060..1083
                                                                                                                                salt/modules/win_lgpo.py on lines 1087..1109
                                                                                                                                salt/modules/win_lgpo.py on lines 1113..1135
                                                                                                                                salt/modules/win_lgpo.py on lines 1139..1161
                                                                                                                                salt/modules/win_lgpo.py on lines 1165..1187
                                                                                                                                salt/modules/win_lgpo.py on lines 1191..1213
                                                                                                                                salt/modules/win_lgpo.py on lines 1217..1239
                                                                                                                                salt/modules/win_lgpo.py on lines 1243..1266
                                                                                                                                salt/modules/win_lgpo.py on lines 1270..1293
                                                                                                                                salt/modules/win_lgpo.py on lines 1324..1347
                                                                                                                                salt/modules/win_lgpo.py on lines 1351..1374
                                                                                                                                salt/modules/win_lgpo.py on lines 1378..1401
                                                                                                                                salt/modules/win_lgpo.py on lines 1483..1505
                                                                                                                                salt/modules/win_lgpo.py on lines 1509..1531
                                                                                                                                salt/modules/win_lgpo.py on lines 1535..1557
                                                                                                                                salt/modules/win_lgpo.py on lines 1561..1583
                                                                                                                                salt/modules/win_lgpo.py on lines 1587..1609
                                                                                                                                salt/modules/win_lgpo.py on lines 1613..1635

                                                                                                                                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 55.

                                                                                                                                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 24 locations. Consider refactoring.
                                                                                                                                Open

                                                                                                                                                    'WfwPublicSettingsLocalConnectionRules': {
                                                                                                                                                        'Policy': 'Network firewall: Public: Settings: Apply '
                                                                                                                                                                  'local connection security rules',
                                                                                                                                                        'lgpo_section': self.windows_firewall_gpedit_path,
                                                                                                                                                        # Settings available are:
                                                                                                                                Severity: Major
                                                                                                                                Found in salt/modules/win_lgpo.py and 23 other locations - About 1 hr to fix
                                                                                                                                salt/modules/win_lgpo.py on lines 928..950
                                                                                                                                salt/modules/win_lgpo.py on lines 954..976
                                                                                                                                salt/modules/win_lgpo.py on lines 980..1002
                                                                                                                                salt/modules/win_lgpo.py on lines 1006..1029
                                                                                                                                salt/modules/win_lgpo.py on lines 1033..1056
                                                                                                                                salt/modules/win_lgpo.py on lines 1060..1083
                                                                                                                                salt/modules/win_lgpo.py on lines 1087..1109
                                                                                                                                salt/modules/win_lgpo.py on lines 1113..1135
                                                                                                                                salt/modules/win_lgpo.py on lines 1139..1161
                                                                                                                                salt/modules/win_lgpo.py on lines 1165..1187
                                                                                                                                salt/modules/win_lgpo.py on lines 1191..1213
                                                                                                                                salt/modules/win_lgpo.py on lines 1217..1239
                                                                                                                                salt/modules/win_lgpo.py on lines 1243..1266
                                                                                                                                salt/modules/win_lgpo.py on lines 1270..1293
                                                                                                                                salt/modules/win_lgpo.py on lines 1297..1320
                                                                                                                                salt/modules/win_lgpo.py on lines 1324..1347
                                                                                                                                salt/modules/win_lgpo.py on lines 1351..1374
                                                                                                                                salt/modules/win_lgpo.py on lines 1483..1505
                                                                                                                                salt/modules/win_lgpo.py on lines 1509..1531
                                                                                                                                salt/modules/win_lgpo.py on lines 1535..1557
                                                                                                                                salt/modules/win_lgpo.py on lines 1561..1583
                                                                                                                                salt/modules/win_lgpo.py on lines 1587..1609
                                                                                                                                salt/modules/win_lgpo.py on lines 1613..1635

                                                                                                                                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 55.

                                                                                                                                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 24 locations. Consider refactoring.
                                                                                                                                Open

                                                                                                                                                    'WfwPublicLoggingAllowedConnections': {
                                                                                                                                                        'Policy': 'Network firewall: Public: Logging: Log successful connections',
                                                                                                                                                        'lgpo_section': self.windows_firewall_gpedit_path,
                                                                                                                                                        # Settings available are:
                                                                                                                                                        # - Yes
                                                                                                                                Severity: Major
                                                                                                                                Found in salt/modules/win_lgpo.py and 23 other locations - About 1 hr to fix
                                                                                                                                salt/modules/win_lgpo.py on lines 928..950
                                                                                                                                salt/modules/win_lgpo.py on lines 954..976
                                                                                                                                salt/modules/win_lgpo.py on lines 980..1002
                                                                                                                                salt/modules/win_lgpo.py on lines 1006..1029
                                                                                                                                salt/modules/win_lgpo.py on lines 1033..1056
                                                                                                                                salt/modules/win_lgpo.py on lines 1060..1083
                                                                                                                                salt/modules/win_lgpo.py on lines 1087..1109
                                                                                                                                salt/modules/win_lgpo.py on lines 1113..1135
                                                                                                                                salt/modules/win_lgpo.py on lines 1139..1161
                                                                                                                                salt/modules/win_lgpo.py on lines 1165..1187
                                                                                                                                salt/modules/win_lgpo.py on lines 1191..1213
                                                                                                                                salt/modules/win_lgpo.py on lines 1217..1239
                                                                                                                                salt/modules/win_lgpo.py on lines 1243..1266
                                                                                                                                salt/modules/win_lgpo.py on lines 1270..1293
                                                                                                                                salt/modules/win_lgpo.py on lines 1297..1320
                                                                                                                                salt/modules/win_lgpo.py on lines 1324..1347
                                                                                                                                salt/modules/win_lgpo.py on lines 1351..1374
                                                                                                                                salt/modules/win_lgpo.py on lines 1378..1401
                                                                                                                                salt/modules/win_lgpo.py on lines 1483..1505
                                                                                                                                salt/modules/win_lgpo.py on lines 1509..1531
                                                                                                                                salt/modules/win_lgpo.py on lines 1561..1583
                                                                                                                                salt/modules/win_lgpo.py on lines 1587..1609
                                                                                                                                salt/modules/win_lgpo.py on lines 1613..1635

                                                                                                                                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 55.

                                                                                                                                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 24 locations. Consider refactoring.
                                                                                                                                Open

                                                                                                                                                    'WfwPublicOutboundConnections': {
                                                                                                                                                        'Policy': 'Network firewall: Public: Outbound connections',
                                                                                                                                                        'lgpo_section': self.windows_firewall_gpedit_path,
                                                                                                                                                        # Settings available are:
                                                                                                                                                        # - Block
                                                                                                                                Severity: Major
                                                                                                                                Found in salt/modules/win_lgpo.py and 23 other locations - About 1 hr to fix
                                                                                                                                salt/modules/win_lgpo.py on lines 928..950
                                                                                                                                salt/modules/win_lgpo.py on lines 954..976
                                                                                                                                salt/modules/win_lgpo.py on lines 980..1002
                                                                                                                                salt/modules/win_lgpo.py on lines 1006..1029
                                                                                                                                salt/modules/win_lgpo.py on lines 1033..1056
                                                                                                                                salt/modules/win_lgpo.py on lines 1060..1083
                                                                                                                                salt/modules/win_lgpo.py on lines 1087..1109
                                                                                                                                salt/modules/win_lgpo.py on lines 1113..1135
                                                                                                                                salt/modules/win_lgpo.py on lines 1165..1187
                                                                                                                                salt/modules/win_lgpo.py on lines 1191..1213
                                                                                                                                salt/modules/win_lgpo.py on lines 1217..1239
                                                                                                                                salt/modules/win_lgpo.py on lines 1243..1266
                                                                                                                                salt/modules/win_lgpo.py on lines 1270..1293
                                                                                                                                salt/modules/win_lgpo.py on lines 1297..1320
                                                                                                                                salt/modules/win_lgpo.py on lines 1324..1347
                                                                                                                                salt/modules/win_lgpo.py on lines 1351..1374
                                                                                                                                salt/modules/win_lgpo.py on lines 1378..1401
                                                                                                                                salt/modules/win_lgpo.py on lines 1483..1505
                                                                                                                                salt/modules/win_lgpo.py on lines 1509..1531
                                                                                                                                salt/modules/win_lgpo.py on lines 1535..1557
                                                                                                                                salt/modules/win_lgpo.py on lines 1561..1583
                                                                                                                                salt/modules/win_lgpo.py on lines 1587..1609
                                                                                                                                salt/modules/win_lgpo.py on lines 1613..1635

                                                                                                                                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 55.

                                                                                                                                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 24 locations. Consider refactoring.
                                                                                                                                Open

                                                                                                                                                    'WfwDomainLoggingDroppedConnections': {
                                                                                                                                                        'Policy': 'Network firewall: Domain: Logging: Log dropped packets',
                                                                                                                                                        'lgpo_section': self.windows_firewall_gpedit_path,
                                                                                                                                                        # Settings available are:
                                                                                                                                                        # - Yes
                                                                                                                                Severity: Major
                                                                                                                                Found in salt/modules/win_lgpo.py and 23 other locations - About 1 hr to fix
                                                                                                                                salt/modules/win_lgpo.py on lines 928..950
                                                                                                                                salt/modules/win_lgpo.py on lines 954..976
                                                                                                                                salt/modules/win_lgpo.py on lines 980..1002
                                                                                                                                salt/modules/win_lgpo.py on lines 1006..1029
                                                                                                                                salt/modules/win_lgpo.py on lines 1033..1056
                                                                                                                                salt/modules/win_lgpo.py on lines 1060..1083
                                                                                                                                salt/modules/win_lgpo.py on lines 1087..1109
                                                                                                                                salt/modules/win_lgpo.py on lines 1113..1135
                                                                                                                                salt/modules/win_lgpo.py on lines 1139..1161
                                                                                                                                salt/modules/win_lgpo.py on lines 1165..1187
                                                                                                                                salt/modules/win_lgpo.py on lines 1191..1213
                                                                                                                                salt/modules/win_lgpo.py on lines 1217..1239
                                                                                                                                salt/modules/win_lgpo.py on lines 1243..1266
                                                                                                                                salt/modules/win_lgpo.py on lines 1270..1293
                                                                                                                                salt/modules/win_lgpo.py on lines 1297..1320
                                                                                                                                salt/modules/win_lgpo.py on lines 1324..1347
                                                                                                                                salt/modules/win_lgpo.py on lines 1351..1374
                                                                                                                                salt/modules/win_lgpo.py on lines 1378..1401
                                                                                                                                salt/modules/win_lgpo.py on lines 1483..1505
                                                                                                                                salt/modules/win_lgpo.py on lines 1509..1531
                                                                                                                                salt/modules/win_lgpo.py on lines 1535..1557
                                                                                                                                salt/modules/win_lgpo.py on lines 1587..1609
                                                                                                                                salt/modules/win_lgpo.py on lines 1613..1635

                                                                                                                                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 55.

                                                                                                                                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 24 locations. Consider refactoring.
                                                                                                                                Open

                                                                                                                                                    'WfwPrivateInboundConnections': {
                                                                                                                                                        'Policy': 'Network firewall: Private: Inbound connections',
                                                                                                                                                        'lgpo_section': self.windows_firewall_gpedit_path,
                                                                                                                                                        # Settings available are:
                                                                                                                                                        # - Block (default)
                                                                                                                                Severity: Major
                                                                                                                                Found in salt/modules/win_lgpo.py and 23 other locations - About 1 hr to fix
                                                                                                                                salt/modules/win_lgpo.py on lines 928..950
                                                                                                                                salt/modules/win_lgpo.py on lines 954..976
                                                                                                                                salt/modules/win_lgpo.py on lines 980..1002
                                                                                                                                salt/modules/win_lgpo.py on lines 1006..1029
                                                                                                                                salt/modules/win_lgpo.py on lines 1060..1083
                                                                                                                                salt/modules/win_lgpo.py on lines 1087..1109
                                                                                                                                salt/modules/win_lgpo.py on lines 1113..1135
                                                                                                                                salt/modules/win_lgpo.py on lines 1139..1161
                                                                                                                                salt/modules/win_lgpo.py on lines 1165..1187
                                                                                                                                salt/modules/win_lgpo.py on lines 1191..1213
                                                                                                                                salt/modules/win_lgpo.py on lines 1217..1239
                                                                                                                                salt/modules/win_lgpo.py on lines 1243..1266
                                                                                                                                salt/modules/win_lgpo.py on lines 1270..1293
                                                                                                                                salt/modules/win_lgpo.py on lines 1297..1320
                                                                                                                                salt/modules/win_lgpo.py on lines 1324..1347
                                                                                                                                salt/modules/win_lgpo.py on lines 1351..1374
                                                                                                                                salt/modules/win_lgpo.py on lines 1378..1401
                                                                                                                                salt/modules/win_lgpo.py on lines 1483..1505
                                                                                                                                salt/modules/win_lgpo.py on lines 1509..1531
                                                                                                                                salt/modules/win_lgpo.py on lines 1535..1557
                                                                                                                                salt/modules/win_lgpo.py on lines 1561..1583
                                                                                                                                salt/modules/win_lgpo.py on lines 1587..1609
                                                                                                                                salt/modules/win_lgpo.py on lines 1613..1635

                                                                                                                                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 55.

                                                                                                                                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 24 locations. Consider refactoring.
                                                                                                                                Open

                                                                                                                                                    'WfwPublicSettingsNotification': {
                                                                                                                                                        'Policy': 'Network firewall: Public: Settings: Display a notification',
                                                                                                                                                        'lgpo_section': self.windows_firewall_gpedit_path,
                                                                                                                                                        # Settings available are:
                                                                                                                                                        # - Yes
                                                                                                                                Severity: Major
                                                                                                                                Found in salt/modules/win_lgpo.py and 23 other locations - About 1 hr to fix
                                                                                                                                salt/modules/win_lgpo.py on lines 928..950
                                                                                                                                salt/modules/win_lgpo.py on lines 954..976
                                                                                                                                salt/modules/win_lgpo.py on lines 980..1002
                                                                                                                                salt/modules/win_lgpo.py on lines 1006..1029
                                                                                                                                salt/modules/win_lgpo.py on lines 1033..1056
                                                                                                                                salt/modules/win_lgpo.py on lines 1060..1083
                                                                                                                                salt/modules/win_lgpo.py on lines 1087..1109
                                                                                                                                salt/modules/win_lgpo.py on lines 1113..1135
                                                                                                                                salt/modules/win_lgpo.py on lines 1139..1161
                                                                                                                                salt/modules/win_lgpo.py on lines 1165..1187
                                                                                                                                salt/modules/win_lgpo.py on lines 1191..1213
                                                                                                                                salt/modules/win_lgpo.py on lines 1243..1266
                                                                                                                                salt/modules/win_lgpo.py on lines 1270..1293
                                                                                                                                salt/modules/win_lgpo.py on lines 1297..1320
                                                                                                                                salt/modules/win_lgpo.py on lines 1324..1347
                                                                                                                                salt/modules/win_lgpo.py on lines 1351..1374
                                                                                                                                salt/modules/win_lgpo.py on lines 1378..1401
                                                                                                                                salt/modules/win_lgpo.py on lines 1483..1505
                                                                                                                                salt/modules/win_lgpo.py on lines 1509..1531
                                                                                                                                salt/modules/win_lgpo.py on lines 1535..1557
                                                                                                                                salt/modules/win_lgpo.py on lines 1561..1583
                                                                                                                                salt/modules/win_lgpo.py on lines 1587..1609
                                                                                                                                salt/modules/win_lgpo.py on lines 1613..1635

                                                                                                                                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 55.

                                                                                                                                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 24 locations. Consider refactoring.
                                                                                                                                Open

                                                                                                                                                    'WfwPrivateSettingsLocalConnectionRules': {
                                                                                                                                                        'Policy': 'Network firewall: Private: Settings: Apply '
                                                                                                                                                                  'local connection security rules',
                                                                                                                                                        'lgpo_section': self.windows_firewall_gpedit_path,
                                                                                                                                                        # Settings available are:
                                                                                                                                Severity: Major
                                                                                                                                Found in salt/modules/win_lgpo.py and 23 other locations - About 1 hr to fix
                                                                                                                                salt/modules/win_lgpo.py on lines 928..950
                                                                                                                                salt/modules/win_lgpo.py on lines 954..976
                                                                                                                                salt/modules/win_lgpo.py on lines 980..1002
                                                                                                                                salt/modules/win_lgpo.py on lines 1006..1029
                                                                                                                                salt/modules/win_lgpo.py on lines 1033..1056
                                                                                                                                salt/modules/win_lgpo.py on lines 1060..1083
                                                                                                                                salt/modules/win_lgpo.py on lines 1087..1109
                                                                                                                                salt/modules/win_lgpo.py on lines 1113..1135
                                                                                                                                salt/modules/win_lgpo.py on lines 1139..1161
                                                                                                                                salt/modules/win_lgpo.py on lines 1165..1187
                                                                                                                                salt/modules/win_lgpo.py on lines 1191..1213
                                                                                                                                salt/modules/win_lgpo.py on lines 1217..1239
                                                                                                                                salt/modules/win_lgpo.py on lines 1243..1266
                                                                                                                                salt/modules/win_lgpo.py on lines 1270..1293
                                                                                                                                salt/modules/win_lgpo.py on lines 1297..1320
                                                                                                                                salt/modules/win_lgpo.py on lines 1324..1347
                                                                                                                                salt/modules/win_lgpo.py on lines 1378..1401
                                                                                                                                salt/modules/win_lgpo.py on lines 1483..1505
                                                                                                                                salt/modules/win_lgpo.py on lines 1509..1531
                                                                                                                                salt/modules/win_lgpo.py on lines 1535..1557
                                                                                                                                salt/modules/win_lgpo.py on lines 1561..1583
                                                                                                                                salt/modules/win_lgpo.py on lines 1587..1609
                                                                                                                                salt/modules/win_lgpo.py on lines 1613..1635

                                                                                                                                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 55.

                                                                                                                                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 24 locations. Consider refactoring.
                                                                                                                                Open

                                                                                                                                                    'WfwPrivateLoggingAllowedConnections': {
                                                                                                                                                        'Policy': 'Network firewall: Private: Logging: Log successful connections',
                                                                                                                                                        'lgpo_section': self.windows_firewall_gpedit_path,
                                                                                                                                                        # Settings available are:
                                                                                                                                                        # - Yes
                                                                                                                                Severity: Major
                                                                                                                                Found in salt/modules/win_lgpo.py and 23 other locations - About 1 hr to fix
                                                                                                                                salt/modules/win_lgpo.py on lines 928..950
                                                                                                                                salt/modules/win_lgpo.py on lines 954..976
                                                                                                                                salt/modules/win_lgpo.py on lines 980..1002
                                                                                                                                salt/modules/win_lgpo.py on lines 1006..1029
                                                                                                                                salt/modules/win_lgpo.py on lines 1033..1056
                                                                                                                                salt/modules/win_lgpo.py on lines 1060..1083
                                                                                                                                salt/modules/win_lgpo.py on lines 1087..1109
                                                                                                                                salt/modules/win_lgpo.py on lines 1113..1135
                                                                                                                                salt/modules/win_lgpo.py on lines 1139..1161
                                                                                                                                salt/modules/win_lgpo.py on lines 1165..1187
                                                                                                                                salt/modules/win_lgpo.py on lines 1191..1213
                                                                                                                                salt/modules/win_lgpo.py on lines 1217..1239
                                                                                                                                salt/modules/win_lgpo.py on lines 1243..1266
                                                                                                                                salt/modules/win_lgpo.py on lines 1270..1293
                                                                                                                                salt/modules/win_lgpo.py on lines 1297..1320
                                                                                                                                salt/modules/win_lgpo.py on lines 1324..1347
                                                                                                                                salt/modules/win_lgpo.py on lines 1351..1374
                                                                                                                                salt/modules/win_lgpo.py on lines 1378..1401
                                                                                                                                salt/modules/win_lgpo.py on lines 1483..1505
                                                                                                                                salt/modules/win_lgpo.py on lines 1535..1557
                                                                                                                                salt/modules/win_lgpo.py on lines 1561..1583
                                                                                                                                salt/modules/win_lgpo.py on lines 1587..1609
                                                                                                                                salt/modules/win_lgpo.py on lines 1613..1635

                                                                                                                                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 55.

                                                                                                                                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 24 locations. Consider refactoring.
                                                                                                                                Open

                                                                                                                                                    'WfwPrivateState': {
                                                                                                                                                        'Policy': 'Network firewall: Private: State',
                                                                                                                                                        'lgpo_section': self.windows_firewall_gpedit_path,
                                                                                                                                                        # Settings available are:
                                                                                                                                                        # - On (recommended)
                                                                                                                                Severity: Major
                                                                                                                                Found in salt/modules/win_lgpo.py and 23 other locations - About 1 hr to fix
                                                                                                                                salt/modules/win_lgpo.py on lines 928..950
                                                                                                                                salt/modules/win_lgpo.py on lines 980..1002
                                                                                                                                salt/modules/win_lgpo.py on lines 1006..1029
                                                                                                                                salt/modules/win_lgpo.py on lines 1033..1056
                                                                                                                                salt/modules/win_lgpo.py on lines 1060..1083
                                                                                                                                salt/modules/win_lgpo.py on lines 1087..1109
                                                                                                                                salt/modules/win_lgpo.py on lines 1113..1135
                                                                                                                                salt/modules/win_lgpo.py on lines 1139..1161
                                                                                                                                salt/modules/win_lgpo.py on lines 1165..1187
                                                                                                                                salt/modules/win_lgpo.py on lines 1191..1213
                                                                                                                                salt/modules/win_lgpo.py on lines 1217..1239
                                                                                                                                salt/modules/win_lgpo.py on lines 1243..1266
                                                                                                                                salt/modules/win_lgpo.py on lines 1270..1293
                                                                                                                                salt/modules/win_lgpo.py on lines 1297..1320
                                                                                                                                salt/modules/win_lgpo.py on lines 1324..1347
                                                                                                                                salt/modules/win_lgpo.py on lines 1351..1374
                                                                                                                                salt/modules/win_lgpo.py on lines 1378..1401
                                                                                                                                salt/modules/win_lgpo.py on lines 1483..1505
                                                                                                                                salt/modules/win_lgpo.py on lines 1509..1531
                                                                                                                                salt/modules/win_lgpo.py on lines 1535..1557
                                                                                                                                salt/modules/win_lgpo.py on lines 1561..1583
                                                                                                                                salt/modules/win_lgpo.py on lines 1587..1609
                                                                                                                                salt/modules/win_lgpo.py on lines 1613..1635

                                                                                                                                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 55.

                                                                                                                                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 24 locations. Consider refactoring.
                                                                                                                                Open

                                                                                                                                                    'WfwPrivateSettingsNotification': {
                                                                                                                                                        'Policy': 'Network firewall: Private: Settings: Display a notification',
                                                                                                                                                        'lgpo_section': self.windows_firewall_gpedit_path,
                                                                                                                                                        # Settings available are:
                                                                                                                                                        # - Yes
                                                                                                                                Severity: Major
                                                                                                                                Found in salt/modules/win_lgpo.py and 23 other locations - About 1 hr to fix
                                                                                                                                salt/modules/win_lgpo.py on lines 928..950
                                                                                                                                salt/modules/win_lgpo.py on lines 954..976
                                                                                                                                salt/modules/win_lgpo.py on lines 980..1002
                                                                                                                                salt/modules/win_lgpo.py on lines 1006..1029
                                                                                                                                salt/modules/win_lgpo.py on lines 1033..1056
                                                                                                                                salt/modules/win_lgpo.py on lines 1060..1083
                                                                                                                                salt/modules/win_lgpo.py on lines 1087..1109
                                                                                                                                salt/modules/win_lgpo.py on lines 1113..1135
                                                                                                                                salt/modules/win_lgpo.py on lines 1139..1161
                                                                                                                                salt/modules/win_lgpo.py on lines 1165..1187
                                                                                                                                salt/modules/win_lgpo.py on lines 1217..1239
                                                                                                                                salt/modules/win_lgpo.py on lines 1243..1266
                                                                                                                                salt/modules/win_lgpo.py on lines 1270..1293
                                                                                                                                salt/modules/win_lgpo.py on lines 1297..1320
                                                                                                                                salt/modules/win_lgpo.py on lines 1324..1347
                                                                                                                                salt/modules/win_lgpo.py on lines 1351..1374
                                                                                                                                salt/modules/win_lgpo.py on lines 1378..1401
                                                                                                                                salt/modules/win_lgpo.py on lines 1483..1505
                                                                                                                                salt/modules/win_lgpo.py on lines 1509..1531
                                                                                                                                salt/modules/win_lgpo.py on lines 1535..1557
                                                                                                                                salt/modules/win_lgpo.py on lines 1561..1583
                                                                                                                                salt/modules/win_lgpo.py on lines 1587..1609
                                                                                                                                salt/modules/win_lgpo.py on lines 1613..1635

                                                                                                                                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 55.

                                                                                                                                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 24 locations. Consider refactoring.
                                                                                                                                Open

                                                                                                                                                    'WfwDomainLoggingAllowedConnections': {
                                                                                                                                                        'Policy': 'Network firewall: Domain: Logging: Log successful connections',
                                                                                                                                                        'lgpo_section': self.windows_firewall_gpedit_path,
                                                                                                                                                        # Settings available are:
                                                                                                                                                        # - Yes
                                                                                                                                Severity: Major
                                                                                                                                Found in salt/modules/win_lgpo.py and 23 other locations - About 1 hr to fix
                                                                                                                                salt/modules/win_lgpo.py on lines 928..950
                                                                                                                                salt/modules/win_lgpo.py on lines 954..976
                                                                                                                                salt/modules/win_lgpo.py on lines 980..1002
                                                                                                                                salt/modules/win_lgpo.py on lines 1006..1029
                                                                                                                                salt/modules/win_lgpo.py on lines 1033..1056
                                                                                                                                salt/modules/win_lgpo.py on lines 1060..1083
                                                                                                                                salt/modules/win_lgpo.py on lines 1087..1109
                                                                                                                                salt/modules/win_lgpo.py on lines 1113..1135
                                                                                                                                salt/modules/win_lgpo.py on lines 1139..1161
                                                                                                                                salt/modules/win_lgpo.py on lines 1165..1187
                                                                                                                                salt/modules/win_lgpo.py on lines 1191..1213
                                                                                                                                salt/modules/win_lgpo.py on lines 1217..1239
                                                                                                                                salt/modules/win_lgpo.py on lines 1243..1266
                                                                                                                                salt/modules/win_lgpo.py on lines 1270..1293
                                                                                                                                salt/modules/win_lgpo.py on lines 1297..1320
                                                                                                                                salt/modules/win_lgpo.py on lines 1324..1347
                                                                                                                                salt/modules/win_lgpo.py on lines 1351..1374
                                                                                                                                salt/modules/win_lgpo.py on lines 1378..1401
                                                                                                                                salt/modules/win_lgpo.py on lines 1509..1531
                                                                                                                                salt/modules/win_lgpo.py on lines 1535..1557
                                                                                                                                salt/modules/win_lgpo.py on lines 1561..1583
                                                                                                                                salt/modules/win_lgpo.py on lines 1587..1609
                                                                                                                                salt/modules/win_lgpo.py on lines 1613..1635

                                                                                                                                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 55.

                                                                                                                                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 24 locations. Consider refactoring.
                                                                                                                                Open

                                                                                                                                                    'WfwDomainSettingsLocalFirewallRules': {
                                                                                                                                                        'Policy': 'Network firewall: Domain: Settings: Apply '
                                                                                                                                                                  'local firewall rules',
                                                                                                                                                        'lgpo_section': self.windows_firewall_gpedit_path,
                                                                                                                                                        # Settings available are:
                                                                                                                                Severity: Major
                                                                                                                                Found in salt/modules/win_lgpo.py and 23 other locations - About 1 hr to fix
                                                                                                                                salt/modules/win_lgpo.py on lines 928..950
                                                                                                                                salt/modules/win_lgpo.py on lines 954..976
                                                                                                                                salt/modules/win_lgpo.py on lines 980..1002
                                                                                                                                salt/modules/win_lgpo.py on lines 1006..1029
                                                                                                                                salt/modules/win_lgpo.py on lines 1033..1056
                                                                                                                                salt/modules/win_lgpo.py on lines 1060..1083
                                                                                                                                salt/modules/win_lgpo.py on lines 1087..1109
                                                                                                                                salt/modules/win_lgpo.py on lines 1113..1135
                                                                                                                                salt/modules/win_lgpo.py on lines 1139..1161
                                                                                                                                salt/modules/win_lgpo.py on lines 1165..1187
                                                                                                                                salt/modules/win_lgpo.py on lines 1191..1213
                                                                                                                                salt/modules/win_lgpo.py on lines 1217..1239
                                                                                                                                salt/modules/win_lgpo.py on lines 1270..1293
                                                                                                                                salt/modules/win_lgpo.py on lines 1297..1320
                                                                                                                                salt/modules/win_lgpo.py on lines 1324..1347
                                                                                                                                salt/modules/win_lgpo.py on lines 1351..1374
                                                                                                                                salt/modules/win_lgpo.py on lines 1378..1401
                                                                                                                                salt/modules/win_lgpo.py on lines 1483..1505
                                                                                                                                salt/modules/win_lgpo.py on lines 1509..1531
                                                                                                                                salt/modules/win_lgpo.py on lines 1535..1557
                                                                                                                                salt/modules/win_lgpo.py on lines 1561..1583
                                                                                                                                salt/modules/win_lgpo.py on lines 1587..1609
                                                                                                                                salt/modules/win_lgpo.py on lines 1613..1635

                                                                                                                                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 55.

                                                                                                                                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 24 locations. Consider refactoring.
                                                                                                                                Open

                                                                                                                                                    'WfwDomainInboundConnections': {
                                                                                                                                                        'Policy': 'Network firewall: Domain: Inbound connections',
                                                                                                                                                        'lgpo_section': self.windows_firewall_gpedit_path,
                                                                                                                                                        # Settings available are:
                                                                                                                                                        # - Block (default)
                                                                                                                                Severity: Major
                                                                                                                                Found in salt/modules/win_lgpo.py and 23 other locations - About 1 hr to fix
                                                                                                                                salt/modules/win_lgpo.py on lines 928..950
                                                                                                                                salt/modules/win_lgpo.py on lines 954..976
                                                                                                                                salt/modules/win_lgpo.py on lines 980..1002
                                                                                                                                salt/modules/win_lgpo.py on lines 1033..1056
                                                                                                                                salt/modules/win_lgpo.py on lines 1060..1083
                                                                                                                                salt/modules/win_lgpo.py on lines 1087..1109
                                                                                                                                salt/modules/win_lgpo.py on lines 1113..1135
                                                                                                                                salt/modules/win_lgpo.py on lines 1139..1161
                                                                                                                                salt/modules/win_lgpo.py on lines 1165..1187
                                                                                                                                salt/modules/win_lgpo.py on lines 1191..1213
                                                                                                                                salt/modules/win_lgpo.py on lines 1217..1239
                                                                                                                                salt/modules/win_lgpo.py on lines 1243..1266
                                                                                                                                salt/modules/win_lgpo.py on lines 1270..1293
                                                                                                                                salt/modules/win_lgpo.py on lines 1297..1320
                                                                                                                                salt/modules/win_lgpo.py on lines 1324..1347
                                                                                                                                salt/modules/win_lgpo.py on lines 1351..1374
                                                                                                                                salt/modules/win_lgpo.py on lines 1378..1401
                                                                                                                                salt/modules/win_lgpo.py on lines 1483..1505
                                                                                                                                salt/modules/win_lgpo.py on lines 1509..1531
                                                                                                                                salt/modules/win_lgpo.py on lines 1535..1557
                                                                                                                                salt/modules/win_lgpo.py on lines 1561..1583
                                                                                                                                salt/modules/win_lgpo.py on lines 1587..1609
                                                                                                                                salt/modules/win_lgpo.py on lines 1613..1635

                                                                                                                                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 55.

                                                                                                                                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 24 locations. Consider refactoring.
                                                                                                                                Open

                                                                                                                                                    'WfwPublicInboundConnections': {
                                                                                                                                                        'Policy': 'Network firewall: Public: Inbound connections',
                                                                                                                                                        'lgpo_section': self.windows_firewall_gpedit_path,
                                                                                                                                                        # Settings available are:
                                                                                                                                                        # - Block (default)
                                                                                                                                Severity: Major
                                                                                                                                Found in salt/modules/win_lgpo.py and 23 other locations - About 1 hr to fix
                                                                                                                                salt/modules/win_lgpo.py on lines 928..950
                                                                                                                                salt/modules/win_lgpo.py on lines 954..976
                                                                                                                                salt/modules/win_lgpo.py on lines 980..1002
                                                                                                                                salt/modules/win_lgpo.py on lines 1006..1029
                                                                                                                                salt/modules/win_lgpo.py on lines 1033..1056
                                                                                                                                salt/modules/win_lgpo.py on lines 1087..1109
                                                                                                                                salt/modules/win_lgpo.py on lines 1113..1135
                                                                                                                                salt/modules/win_lgpo.py on lines 1139..1161
                                                                                                                                salt/modules/win_lgpo.py on lines 1165..1187
                                                                                                                                salt/modules/win_lgpo.py on lines 1191..1213
                                                                                                                                salt/modules/win_lgpo.py on lines 1217..1239
                                                                                                                                salt/modules/win_lgpo.py on lines 1243..1266
                                                                                                                                salt/modules/win_lgpo.py on lines 1270..1293
                                                                                                                                salt/modules/win_lgpo.py on lines 1297..1320
                                                                                                                                salt/modules/win_lgpo.py on lines 1324..1347
                                                                                                                                salt/modules/win_lgpo.py on lines 1351..1374
                                                                                                                                salt/modules/win_lgpo.py on lines 1378..1401
                                                                                                                                salt/modules/win_lgpo.py on lines 1483..1505
                                                                                                                                salt/modules/win_lgpo.py on lines 1509..1531
                                                                                                                                salt/modules/win_lgpo.py on lines 1535..1557
                                                                                                                                salt/modules/win_lgpo.py on lines 1561..1583
                                                                                                                                salt/modules/win_lgpo.py on lines 1587..1609
                                                                                                                                salt/modules/win_lgpo.py on lines 1613..1635

                                                                                                                                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 55.

                                                                                                                                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 24 locations. Consider refactoring.
                                                                                                                                Open

                                                                                                                                                    'WfwPrivateLoggingDroppedConnections': {
                                                                                                                                                        'Policy': 'Network firewall: Private: Logging: Log dropped packets',
                                                                                                                                                        'lgpo_section': self.windows_firewall_gpedit_path,
                                                                                                                                                        # Settings available are:
                                                                                                                                                        # - Yes
                                                                                                                                Severity: Major
                                                                                                                                Found in salt/modules/win_lgpo.py and 23 other locations - About 1 hr to fix
                                                                                                                                salt/modules/win_lgpo.py on lines 928..950
                                                                                                                                salt/modules/win_lgpo.py on lines 954..976
                                                                                                                                salt/modules/win_lgpo.py on lines 980..1002
                                                                                                                                salt/modules/win_lgpo.py on lines 1006..1029
                                                                                                                                salt/modules/win_lgpo.py on lines 1033..1056
                                                                                                                                salt/modules/win_lgpo.py on lines 1060..1083
                                                                                                                                salt/modules/win_lgpo.py on lines 1087..1109
                                                                                                                                salt/modules/win_lgpo.py on lines 1113..1135
                                                                                                                                salt/modules/win_lgpo.py on lines 1139..1161
                                                                                                                                salt/modules/win_lgpo.py on lines 1165..1187
                                                                                                                                salt/modules/win_lgpo.py on lines 1191..1213
                                                                                                                                salt/modules/win_lgpo.py on lines 1217..1239
                                                                                                                                salt/modules/win_lgpo.py on lines 1243..1266
                                                                                                                                salt/modules/win_lgpo.py on lines 1270..1293
                                                                                                                                salt/modules/win_lgpo.py on lines 1297..1320
                                                                                                                                salt/modules/win_lgpo.py on lines 1324..1347
                                                                                                                                salt/modules/win_lgpo.py on lines 1351..1374
                                                                                                                                salt/modules/win_lgpo.py on lines 1378..1401
                                                                                                                                salt/modules/win_lgpo.py on lines 1483..1505
                                                                                                                                salt/modules/win_lgpo.py on lines 1509..1531
                                                                                                                                salt/modules/win_lgpo.py on lines 1535..1557
                                                                                                                                salt/modules/win_lgpo.py on lines 1561..1583
                                                                                                                                salt/modules/win_lgpo.py on lines 1613..1635

                                                                                                                                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 55.

                                                                                                                                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 24 locations. Consider refactoring.
                                                                                                                                Open

                                                                                                                                                    'WfwPublicLoggingDroppedConnections': {
                                                                                                                                                        'Policy': 'Network firewall: Public: Logging: Log dropped packets',
                                                                                                                                                        'lgpo_section': self.windows_firewall_gpedit_path,
                                                                                                                                                        # Settings available are:
                                                                                                                                                        # - Yes
                                                                                                                                Severity: Major
                                                                                                                                Found in salt/modules/win_lgpo.py and 23 other locations - About 1 hr to fix
                                                                                                                                salt/modules/win_lgpo.py on lines 928..950
                                                                                                                                salt/modules/win_lgpo.py on lines 954..976
                                                                                                                                salt/modules/win_lgpo.py on lines 980..1002
                                                                                                                                salt/modules/win_lgpo.py on lines 1006..1029
                                                                                                                                salt/modules/win_lgpo.py on lines 1033..1056
                                                                                                                                salt/modules/win_lgpo.py on lines 1060..1083
                                                                                                                                salt/modules/win_lgpo.py on lines 1087..1109
                                                                                                                                salt/modules/win_lgpo.py on lines 1113..1135
                                                                                                                                salt/modules/win_lgpo.py on lines 1139..1161
                                                                                                                                salt/modules/win_lgpo.py on lines 1165..1187
                                                                                                                                salt/modules/win_lgpo.py on lines 1191..1213
                                                                                                                                salt/modules/win_lgpo.py on lines 1217..1239
                                                                                                                                salt/modules/win_lgpo.py on lines 1243..1266
                                                                                                                                salt/modules/win_lgpo.py on lines 1270..1293
                                                                                                                                salt/modules/win_lgpo.py on lines 1297..1320
                                                                                                                                salt/modules/win_lgpo.py on lines 1324..1347
                                                                                                                                salt/modules/win_lgpo.py on lines 1351..1374
                                                                                                                                salt/modules/win_lgpo.py on lines 1378..1401
                                                                                                                                salt/modules/win_lgpo.py on lines 1483..1505
                                                                                                                                salt/modules/win_lgpo.py on lines 1509..1531
                                                                                                                                salt/modules/win_lgpo.py on lines 1535..1557
                                                                                                                                salt/modules/win_lgpo.py on lines 1561..1583
                                                                                                                                salt/modules/win_lgpo.py on lines 1587..1609

                                                                                                                                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 55.

                                                                                                                                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 24 locations. Consider refactoring.
                                                                                                                                Open

                                                                                                                                                    'WfwDomainSettingsLocalConnectionRules': {
                                                                                                                                                        'Policy': 'Network firewall: Domain: Settings: Apply '
                                                                                                                                                                  'local connection security rules',
                                                                                                                                                        'lgpo_section': self.windows_firewall_gpedit_path,
                                                                                                                                                        # Settings available are:
                                                                                                                                Severity: Major
                                                                                                                                Found in salt/modules/win_lgpo.py and 23 other locations - About 1 hr to fix
                                                                                                                                salt/modules/win_lgpo.py on lines 928..950
                                                                                                                                salt/modules/win_lgpo.py on lines 954..976
                                                                                                                                salt/modules/win_lgpo.py on lines 980..1002
                                                                                                                                salt/modules/win_lgpo.py on lines 1006..1029
                                                                                                                                salt/modules/win_lgpo.py on lines 1033..1056
                                                                                                                                salt/modules/win_lgpo.py on lines 1060..1083
                                                                                                                                salt/modules/win_lgpo.py on lines 1087..1109
                                                                                                                                salt/modules/win_lgpo.py on lines 1113..1135
                                                                                                                                salt/modules/win_lgpo.py on lines 1139..1161
                                                                                                                                salt/modules/win_lgpo.py on lines 1165..1187
                                                                                                                                salt/modules/win_lgpo.py on lines 1191..1213
                                                                                                                                salt/modules/win_lgpo.py on lines 1217..1239
                                                                                                                                salt/modules/win_lgpo.py on lines 1243..1266
                                                                                                                                salt/modules/win_lgpo.py on lines 1270..1293
                                                                                                                                salt/modules/win_lgpo.py on lines 1297..1320
                                                                                                                                salt/modules/win_lgpo.py on lines 1351..1374
                                                                                                                                salt/modules/win_lgpo.py on lines 1378..1401
                                                                                                                                salt/modules/win_lgpo.py on lines 1483..1505
                                                                                                                                salt/modules/win_lgpo.py on lines 1509..1531
                                                                                                                                salt/modules/win_lgpo.py on lines 1535..1557
                                                                                                                                salt/modules/win_lgpo.py on lines 1561..1583
                                                                                                                                salt/modules/win_lgpo.py on lines 1587..1609
                                                                                                                                salt/modules/win_lgpo.py on lines 1613..1635

                                                                                                                                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 55.

                                                                                                                                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 24 locations. Consider refactoring.
                                                                                                                                Open

                                                                                                                                                    'WfwDomainState': {
                                                                                                                                                        'Policy': 'Network firewall: Domain: State',
                                                                                                                                                        'lgpo_section': self.windows_firewall_gpedit_path,
                                                                                                                                                        # Settings available are:
                                                                                                                                                        # - On (recommended)
                                                                                                                                Severity: Major
                                                                                                                                Found in salt/modules/win_lgpo.py and 23 other locations - About 1 hr to fix
                                                                                                                                salt/modules/win_lgpo.py on lines 954..976
                                                                                                                                salt/modules/win_lgpo.py on lines 980..1002
                                                                                                                                salt/modules/win_lgpo.py on lines 1006..1029
                                                                                                                                salt/modules/win_lgpo.py on lines 1033..1056
                                                                                                                                salt/modules/win_lgpo.py on lines 1060..1083
                                                                                                                                salt/modules/win_lgpo.py on lines 1087..1109
                                                                                                                                salt/modules/win_lgpo.py on lines 1113..1135
                                                                                                                                salt/modules/win_lgpo.py on lines 1139..1161
                                                                                                                                salt/modules/win_lgpo.py on lines 1165..1187
                                                                                                                                salt/modules/win_lgpo.py on lines 1191..1213
                                                                                                                                salt/modules/win_lgpo.py on lines 1217..1239
                                                                                                                                salt/modules/win_lgpo.py on lines 1243..1266
                                                                                                                                salt/modules/win_lgpo.py on lines 1270..1293
                                                                                                                                salt/modules/win_lgpo.py on lines 1297..1320
                                                                                                                                salt/modules/win_lgpo.py on lines 1324..1347
                                                                                                                                salt/modules/win_lgpo.py on lines 1351..1374
                                                                                                                                salt/modules/win_lgpo.py on lines 1378..1401
                                                                                                                                salt/modules/win_lgpo.py on lines 1483..1505
                                                                                                                                salt/modules/win_lgpo.py on lines 1509..1531
                                                                                                                                salt/modules/win_lgpo.py on lines 1535..1557
                                                                                                                                salt/modules/win_lgpo.py on lines 1561..1583
                                                                                                                                salt/modules/win_lgpo.py on lines 1587..1609
                                                                                                                                salt/modules/win_lgpo.py on lines 1613..1635

                                                                                                                                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 55.

                                                                                                                                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 24 locations. Consider refactoring.
                                                                                                                                Open

                                                                                                                                                    'WfwDomainSettingsNotification': {
                                                                                                                                                        'Policy': 'Network firewall: Domain: Settings: Display a notification',
                                                                                                                                                        'lgpo_section': self.windows_firewall_gpedit_path,
                                                                                                                                                        # Settings available are:
                                                                                                                                                        # - Yes
                                                                                                                                Severity: Major
                                                                                                                                Found in salt/modules/win_lgpo.py and 23 other locations - About 1 hr to fix
                                                                                                                                salt/modules/win_lgpo.py on lines 928..950
                                                                                                                                salt/modules/win_lgpo.py on lines 954..976
                                                                                                                                salt/modules/win_lgpo.py on lines 980..1002
                                                                                                                                salt/modules/win_lgpo.py on lines 1006..1029
                                                                                                                                salt/modules/win_lgpo.py on lines 1033..1056
                                                                                                                                salt/modules/win_lgpo.py on lines 1060..1083
                                                                                                                                salt/modules/win_lgpo.py on lines 1087..1109
                                                                                                                                salt/modules/win_lgpo.py on lines 1113..1135
                                                                                                                                salt/modules/win_lgpo.py on lines 1139..1161
                                                                                                                                salt/modules/win_lgpo.py on lines 1191..1213
                                                                                                                                salt/modules/win_lgpo.py on lines 1217..1239
                                                                                                                                salt/modules/win_lgpo.py on lines 1243..1266
                                                                                                                                salt/modules/win_lgpo.py on lines 1270..1293
                                                                                                                                salt/modules/win_lgpo.py on lines 1297..1320
                                                                                                                                salt/modules/win_lgpo.py on lines 1324..1347
                                                                                                                                salt/modules/win_lgpo.py on lines 1351..1374
                                                                                                                                salt/modules/win_lgpo.py on lines 1378..1401
                                                                                                                                salt/modules/win_lgpo.py on lines 1483..1505
                                                                                                                                salt/modules/win_lgpo.py on lines 1509..1531
                                                                                                                                salt/modules/win_lgpo.py on lines 1535..1557
                                                                                                                                salt/modules/win_lgpo.py on lines 1561..1583
                                                                                                                                salt/modules/win_lgpo.py on lines 1587..1609
                                                                                                                                salt/modules/win_lgpo.py on lines 1613..1635

                                                                                                                                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 55.

                                                                                                                                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 24 locations. Consider refactoring.
                                                                                                                                Open

                                                                                                                                                    'WfwPrivateSettingsLocalFirewallRules': {
                                                                                                                                                        'Policy': 'Network firewall: Private: Settings: Apply '
                                                                                                                                                                  'local firewall rules',
                                                                                                                                                        'lgpo_section': self.windows_firewall_gpedit_path,
                                                                                                                                                        # Settings available are:
                                                                                                                                Severity: Major
                                                                                                                                Found in salt/modules/win_lgpo.py and 23 other locations - About 1 hr to fix
                                                                                                                                salt/modules/win_lgpo.py on lines 928..950
                                                                                                                                salt/modules/win_lgpo.py on lines 954..976
                                                                                                                                salt/modules/win_lgpo.py on lines 980..1002
                                                                                                                                salt/modules/win_lgpo.py on lines 1006..1029
                                                                                                                                salt/modules/win_lgpo.py on lines 1033..1056
                                                                                                                                salt/modules/win_lgpo.py on lines 1060..1083
                                                                                                                                salt/modules/win_lgpo.py on lines 1087..1109
                                                                                                                                salt/modules/win_lgpo.py on lines 1113..1135
                                                                                                                                salt/modules/win_lgpo.py on lines 1139..1161
                                                                                                                                salt/modules/win_lgpo.py on lines 1165..1187
                                                                                                                                salt/modules/win_lgpo.py on lines 1191..1213
                                                                                                                                salt/modules/win_lgpo.py on lines 1217..1239
                                                                                                                                salt/modules/win_lgpo.py on lines 1243..1266
                                                                                                                                salt/modules/win_lgpo.py on lines 1297..1320
                                                                                                                                salt/modules/win_lgpo.py on lines 1324..1347
                                                                                                                                salt/modules/win_lgpo.py on lines 1351..1374
                                                                                                                                salt/modules/win_lgpo.py on lines 1378..1401
                                                                                                                                salt/modules/win_lgpo.py on lines 1483..1505
                                                                                                                                salt/modules/win_lgpo.py on lines 1509..1531
                                                                                                                                salt/modules/win_lgpo.py on lines 1535..1557
                                                                                                                                salt/modules/win_lgpo.py on lines 1561..1583
                                                                                                                                salt/modules/win_lgpo.py on lines 1587..1609
                                                                                                                                salt/modules/win_lgpo.py on lines 1613..1635

                                                                                                                                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 55.

                                                                                                                                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 24 locations. Consider refactoring.
                                                                                                                                Open

                                                                                                                                                    'WfwPublicState': {
                                                                                                                                                        'Policy': 'Network firewall: Public: State',
                                                                                                                                                        'lgpo_section': self.windows_firewall_gpedit_path,
                                                                                                                                                        # Settings available are:
                                                                                                                                                        # - On (recommended)
                                                                                                                                Severity: Major
                                                                                                                                Found in salt/modules/win_lgpo.py and 23 other locations - About 1 hr to fix
                                                                                                                                salt/modules/win_lgpo.py on lines 928..950
                                                                                                                                salt/modules/win_lgpo.py on lines 954..976
                                                                                                                                salt/modules/win_lgpo.py on lines 1006..1029
                                                                                                                                salt/modules/win_lgpo.py on lines 1033..1056
                                                                                                                                salt/modules/win_lgpo.py on lines 1060..1083
                                                                                                                                salt/modules/win_lgpo.py on lines 1087..1109
                                                                                                                                salt/modules/win_lgpo.py on lines 1113..1135
                                                                                                                                salt/modules/win_lgpo.py on lines 1139..1161
                                                                                                                                salt/modules/win_lgpo.py on lines 1165..1187
                                                                                                                                salt/modules/win_lgpo.py on lines 1191..1213
                                                                                                                                salt/modules/win_lgpo.py on lines 1217..1239
                                                                                                                                salt/modules/win_lgpo.py on lines 1243..1266
                                                                                                                                salt/modules/win_lgpo.py on lines 1270..1293
                                                                                                                                salt/modules/win_lgpo.py on lines 1297..1320
                                                                                                                                salt/modules/win_lgpo.py on lines 1324..1347
                                                                                                                                salt/modules/win_lgpo.py on lines 1351..1374
                                                                                                                                salt/modules/win_lgpo.py on lines 1378..1401
                                                                                                                                salt/modules/win_lgpo.py on lines 1483..1505
                                                                                                                                salt/modules/win_lgpo.py on lines 1509..1531
                                                                                                                                salt/modules/win_lgpo.py on lines 1535..1557
                                                                                                                                salt/modules/win_lgpo.py on lines 1561..1583
                                                                                                                                salt/modules/win_lgpo.py on lines 1587..1609
                                                                                                                                salt/modules/win_lgpo.py on lines 1613..1635

                                                                                                                                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 55.

                                                                                                                                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 24 locations. Consider refactoring.
                                                                                                                                Open

                                                                                                                                                    'WfwDomainOutboundConnections': {
                                                                                                                                                        'Policy': 'Network firewall: Domain: Outbound connections',
                                                                                                                                                        'lgpo_section': self.windows_firewall_gpedit_path,
                                                                                                                                                        # Settings available are:
                                                                                                                                                        # - Block
                                                                                                                                Severity: Major
                                                                                                                                Found in salt/modules/win_lgpo.py and 23 other locations - About 1 hr to fix
                                                                                                                                salt/modules/win_lgpo.py on lines 928..950
                                                                                                                                salt/modules/win_lgpo.py on lines 954..976
                                                                                                                                salt/modules/win_lgpo.py on lines 980..1002
                                                                                                                                salt/modules/win_lgpo.py on lines 1006..1029
                                                                                                                                salt/modules/win_lgpo.py on lines 1033..1056
                                                                                                                                salt/modules/win_lgpo.py on lines 1060..1083
                                                                                                                                salt/modules/win_lgpo.py on lines 1113..1135
                                                                                                                                salt/modules/win_lgpo.py on lines 1139..1161
                                                                                                                                salt/modules/win_lgpo.py on lines 1165..1187
                                                                                                                                salt/modules/win_lgpo.py on lines 1191..1213
                                                                                                                                salt/modules/win_lgpo.py on lines 1217..1239
                                                                                                                                salt/modules/win_lgpo.py on lines 1243..1266
                                                                                                                                salt/modules/win_lgpo.py on lines 1270..1293
                                                                                                                                salt/modules/win_lgpo.py on lines 1297..1320
                                                                                                                                salt/modules/win_lgpo.py on lines 1324..1347
                                                                                                                                salt/modules/win_lgpo.py on lines 1351..1374
                                                                                                                                salt/modules/win_lgpo.py on lines 1378..1401
                                                                                                                                salt/modules/win_lgpo.py on lines 1483..1505
                                                                                                                                salt/modules/win_lgpo.py on lines 1509..1531
                                                                                                                                salt/modules/win_lgpo.py on lines 1535..1557
                                                                                                                                salt/modules/win_lgpo.py on lines 1561..1583
                                                                                                                                salt/modules/win_lgpo.py on lines 1587..1609
                                                                                                                                salt/modules/win_lgpo.py on lines 1613..1635

                                                                                                                                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 55.

                                                                                                                                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

                                                                                                                                                    class_vals[policy_name] = __utils__['reg.read_value'](
                                                                                                                                                        _pol['Registry']['Hive'],
                                                                                                                                                        _pol['Registry']['Path'],
                                                                                                                                                        _pol['Registry']['Value'])['vdata']
                                                                                                                                Severity: Major
                                                                                                                                Found in salt/modules/win_lgpo.py and 2 other locations - About 1 hr to fix
                                                                                                                                salt/states/win_dns_client.py on lines 192..195
                                                                                                                                salt/states/win_dns_client.py on lines 197..200

                                                                                                                                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 55.

                                                                                                                                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

                                                                                                                                                    'StartupPowershellScriptOrder': {
                                                                                                                                                        'Policy': 'Startup - For this GPO, run scripts in the '
                                                                                                                                                                  'following order',
                                                                                                                                                        'lgpo_section': ['Computer Configuration',
                                                                                                                                                                         'Windows Settings',
                                                                                                                                Severity: Major
                                                                                                                                Found in salt/modules/win_lgpo.py and 1 other location - About 1 hr to fix
                                                                                                                                salt/modules/win_lgpo.py on lines 728..748

                                                                                                                                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 55.

                                                                                                                                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

                                                                                                                                                    'ShutdownPowershellScriptOrder': {
                                                                                                                                                        'Policy': 'Shutdown - For this GPO, run scripts in the '
                                                                                                                                                                  'following order',
                                                                                                                                                        'lgpo_section': ['Computer Configuration',
                                                                                                                                                                         'Windows Settings',
                                                                                                                                Severity: Major
                                                                                                                                Found in salt/modules/win_lgpo.py and 1 other location - About 1 hr to fix
                                                                                                                                salt/modules/win_lgpo.py on lines 673..693

                                                                                                                                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 55.

                                                                                                                                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

                                                                                                                                                                                    enabled_value_string = _processValueItem(
                                                                                                                                                                                            child_item,
                                                                                                                                                                                            child_key,
                                                                                                                                                                                            child_valuename,
                                                                                                                                                                                            this_policy,
                                                                                                                                Severity: Major
                                                                                                                                Found in salt/modules/win_lgpo.py and 1 other location - About 1 hr to fix
                                                                                                                                salt/modules/win_lgpo.py on lines 7120..7127

                                                                                                                                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 46.

                                                                                                                                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

                                                                                                                                                                                    enabled_value_string = _processValueItem(
                                                                                                                                                                                            child_item,
                                                                                                                                                                                            child_key,
                                                                                                                                                                                            child_valuename,
                                                                                                                                                                                            this_policy,
                                                                                                                                Severity: Major
                                                                                                                                Found in salt/modules/win_lgpo.py and 1 other location - About 1 hr to fix
                                                                                                                                salt/modules/win_lgpo.py on lines 7076..7083

                                                                                                                                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 46.

                                                                                                                                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

                                                                                                                                                                                elif etree.QName(child_item).localname == 'multiText':
                                                                                                                                                                                    if not isinstance(
                                                                                                                                                                                            _admTemplateData[policy_namespace][policy_name][temp_element_name],
                                                                                                                                                                                            list):
                                                                                                                                                                                        msg = 'Element "{0}" requires a list value'
                                                                                                                                Severity: Major
                                                                                                                                Found in salt/modules/win_lgpo.py and 2 other locations - About 1 hr to fix
                                                                                                                                salt/modules/win_lgpo.py on lines 8091..8100
                                                                                                                                salt/modules/win_lgpo.py on lines 8091..8106

                                                                                                                                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 54.

                                                                                                                                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

                                                                                                                                                                                    if 'explicitValue' in child_item.attrib \
                                                                                                                                                                                                and child_item.attrib['explicitValue'].lower() == \
                                                                                                                                                                                                'true':
                                                                                                                                                                                        if not isinstance(
                                                                                                                                                                                                _admTemplateData[policy_namespace][policy_name][temp_element_name],
                                                                                                                                Severity: Major
                                                                                                                                Found in salt/modules/win_lgpo.py and 2 other locations - About 1 hr to fix
                                                                                                                                salt/modules/win_lgpo.py on lines 8091..8106
                                                                                                                                salt/modules/win_lgpo.py on lines 8107..8113

                                                                                                                                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 54.

                                                                                                                                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

                                                                                                                                                    'NTLMMinServerSec': {
                                                                                                                                                        'Policy': 'Network security: Minimum session security for NTLM SSP based '
                                                                                                                                                                  '(including secure RPC) servers',
                                                                                                                                                        'Settings': None,
                                                                                                                                                        'lgpo_section': self.security_options_gpedit_path,
                                                                                                                                Severity: Major
                                                                                                                                Found in salt/modules/win_lgpo.py and 2 other locations - About 1 hr to fix
                                                                                                                                salt/modules/win_lgpo.py on lines 3957..3978
                                                                                                                                salt/modules/win_lgpo.py on lines 4051..4071

                                                                                                                                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 51.

                                                                                                                                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

                                                                                                                                                    'NTLMMinClientSec': {
                                                                                                                                                        'Policy': 'Network security: Minimum session security for NTLM SSP based '
                                                                                                                                                                  '(including secure RPC) clients',
                                                                                                                                                        'Settings': None,
                                                                                                                                                        'lgpo_section': self.security_options_gpedit_path,
                                                                                                                                Severity: Major
                                                                                                                                Found in salt/modules/win_lgpo.py and 2 other locations - About 1 hr to fix
                                                                                                                                salt/modules/win_lgpo.py on lines 3957..3978
                                                                                                                                salt/modules/win_lgpo.py on lines 4075..4095

                                                                                                                                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 51.

                                                                                                                                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

                                                                                                                                                    'KrbSupportedEncryptionTypes': {
                                                                                                                                                        'Policy': 'Network security: Configure encryption types allowed '
                                                                                                                                                                  'for Kerberos',
                                                                                                                                                        'Settings': None,
                                                                                                                                                        'lgpo_section': self.security_options_gpedit_path,
                                                                                                                                Severity: Major
                                                                                                                                Found in salt/modules/win_lgpo.py and 2 other locations - About 1 hr to fix
                                                                                                                                salt/modules/win_lgpo.py on lines 4051..4071
                                                                                                                                salt/modules/win_lgpo.py on lines 4075..4095

                                                                                                                                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 51.

                                                                                                                                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

                                                                                                                                                                if DISABLED_LIST_XPATH(this_policy):
                                                                                                                                                                    explicit_enable_disable_value_setting = True
                                                                                                                                                                    disabled_list_strings = _checkListItem(this_policy,
                                                                                                                                                                                                           admPolicy,
                                                                                                                                                                                                           this_key,
                                                                                                                                Severity: Major
                                                                                                                                Found in salt/modules/win_lgpo.py and 1 other location - About 1 hr to fix
                                                                                                                                salt/modules/win_lgpo.py on lines 6995..7006

                                                                                                                                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 50.

                                                                                                                                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 _get_policy_definitions(path='c:\\Windows\\PolicyDefinitions',
                                                                                                                                                            language='en-US'):
                                                                                                                                    if 'lgpo.policy_definitions' not in __context__:
                                                                                                                                        log.debug('LGPO: Loading policy definitions')
                                                                                                                                        _load_policy_definitions(path=path, language=language)
                                                                                                                                Severity: Major
                                                                                                                                Found in salt/modules/win_lgpo.py and 1 other location - About 1 hr to fix
                                                                                                                                salt/modules/win_lgpo.py on lines 4955..4960

                                                                                                                                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 50.

                                                                                                                                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 _get_policy_resources(path='c:\\Windows\\PolicyDefinitions',
                                                                                                                                                          language='en-US'):
                                                                                                                                    if 'lgpo.policy_resources' not in __context__:
                                                                                                                                        log.debug('LGPO: Loading policy resources')
                                                                                                                                        _load_policy_definitions(path=path, language=language)
                                                                                                                                Severity: Major
                                                                                                                                Found in salt/modules/win_lgpo.py and 1 other location - About 1 hr to fix
                                                                                                                                salt/modules/win_lgpo.py on lines 4947..4952

                                                                                                                                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 50.

                                                                                                                                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

                                                                                                                                                                if ENABLED_LIST_XPATH(this_policy):
                                                                                                                                                                    explicit_enable_disable_value_setting = True
                                                                                                                                                                    enabled_list_strings = _checkListItem(this_policy,
                                                                                                                                                                                                          admPolicy,
                                                                                                                                                                                                          this_key,
                                                                                                                                Severity: Major
                                                                                                                                Found in salt/modules/win_lgpo.py and 1 other location - About 1 hr to fix
                                                                                                                                salt/modules/win_lgpo.py on lines 6879..6890

                                                                                                                                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 50.

                                                                                                                                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 _checkListItem(child_item,
                                                                                                                                                                                          this_policyname,
                                                                                                                                                                                          this_key,
                                                                                                                                                                                          FALSE_LIST_XPATH,
                                                                                                                                                                                          policy_file_data):
                                                                                                                                Severity: Major
                                                                                                                                Found in salt/modules/win_lgpo.py and 2 other locations - About 1 hr to fix
                                                                                                                                salt/modules/win_lgpo.py on lines 6287..6296
                                                                                                                                salt/modules/win_lgpo.py on lines 6321..6330

                                                                                                                                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 41.

                                                                                                                                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 _checkValueItemParent(child_item,
                                                                                                                                                                                                 this_policyname,
                                                                                                                                                                                                 child_key,
                                                                                                                                                                                                 child_valuename,
                                                                                                                                                                                                 FALSE_VALUE_XPATH,
                                                                                                                                Severity: Major
                                                                                                                                Found in salt/modules/win_lgpo.py and 2 other locations - About 1 hr to fix
                                                                                                                                salt/modules/win_lgpo.py on lines 6311..6319
                                                                                                                                salt/modules/win_lgpo.py on lines 6321..6330

                                                                                                                                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 41.

                                                                                                                                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 _regexSearchRegPolData(re.escape(_processValueItem(child_item,
                                                                                                                                                                                                                          child_key,
                                                                                                                                                                                                                          child_valuename,
                                                                                                                                                                                                                          admx_policy,
                                                                                                                                                                                                                          elements_item,
                                                                                                                                Severity: Major
                                                                                                                                Found in salt/modules/win_lgpo.py and 2 other locations - About 1 hr to fix
                                                                                                                                salt/modules/win_lgpo.py on lines 6287..6296
                                                                                                                                salt/modules/win_lgpo.py on lines 6311..6319

                                                                                                                                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 41.

                                                                                                                                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

                                                                                                                                                                elif _regexSearchRegPolData(re.escape(_processValueItem(child_item,
                                                                                                                                                                                                                        child_key,
                                                                                                                                                                                                                        child_valuename,
                                                                                                                                                                                                                        admx_policy,
                                                                                                                                                                                                                        elements_item,
                                                                                                                                Severity: Major
                                                                                                                                Found in salt/modules/win_lgpo.py and 1 other location - About 1 hr to fix
                                                                                                                                salt/modules/win_lgpo.py on lines 6346..6356

                                                                                                                                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 41.

                                                                                                                                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 _regexSearchRegPolData(re.escape(_processValueItem(child_item,
                                                                                                                                                                                                                      child_key,
                                                                                                                                                                                                                      child_valuename,
                                                                                                                                                                                                                      admx_policy,
                                                                                                                                                                                                                      elements_item,
                                                                                                                                Severity: Major
                                                                                                                                Found in salt/modules/win_lgpo.py and 1 other location - About 1 hr to fix
                                                                                                                                salt/modules/win_lgpo.py on lines 6438..6447

                                                                                                                                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 41.

                                                                                                                                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

                                                                                                                                                            adml_file = os.path.join(
                                                                                                                                                                root,
                                                                                                                                                                display_language_fallback.split('-')[0],
                                                                                                                                                                os.path.splitext(t_admfile)[0] + '.adml')
                                                                                                                                Severity: Major
                                                                                                                                Found in salt/modules/win_lgpo.py and 1 other location - About 1 hr to fix
                                                                                                                                salt/modules/win_lgpo.py on lines 4887..4890

                                                                                                                                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 47.

                                                                                                                                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

                                                                                                                                                    adml_file = os.path.join(
                                                                                                                                                        root,
                                                                                                                                                        language.split('-')[0],
                                                                                                                                                        os.path.splitext(t_admfile)[0] + '.adml')
                                                                                                                                Severity: Major
                                                                                                                                Found in salt/modules/win_lgpo.py and 1 other location - About 1 hr to fix
                                                                                                                                salt/modules/win_lgpo.py on lines 4909..4912

                                                                                                                                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 47.

                                                                                                                                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 7 locations. Consider refactoring.
                                                                                                                                Open

                                                                                                                                def __virtual__():
                                                                                                                                    '''
                                                                                                                                    Only works on Windows systems
                                                                                                                                    '''
                                                                                                                                    if not salt.utils.platform.is_windows():
                                                                                                                                Severity: Major
                                                                                                                                Found in salt/modules/win_lgpo.py and 6 other locations - About 1 hr to fix
                                                                                                                                salt/modules/win_service.py on lines 93..103
                                                                                                                                salt/modules/win_system.py on lines 50..60
                                                                                                                                salt/modules/win_useradd.py on lines 65..75
                                                                                                                                salt/utils/win_dacl.py on lines 157..167
                                                                                                                                salt/utils/win_pdh.py on lines 60..70
                                                                                                                                salt/utils/win_reg.py on lines 60..73

                                                                                                                                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 46.

                                                                                                                                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

                                                                                                                                    if return_full_policy_names and 'displayName' in policy_item.attrib:
                                                                                                                                        fullPolicyName = _getAdmlDisplayName(adml_data, policy_item.attrib['displayName'])
                                                                                                                                        if fullPolicyName:
                                                                                                                                            adm_policy_name_map[return_full_policy_names][policy_name] = fullPolicyName
                                                                                                                                            policy_name = fullPolicyName
                                                                                                                                Severity: Minor
                                                                                                                                Found in salt/modules/win_lgpo.py and 1 other location - About 55 mins to fix
                                                                                                                                salt/modules/win_lgpo.py on lines 5587..5591

                                                                                                                                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 45.

                                                                                                                                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

                                                                                                                                    elif return_full_policy_names and 'id' in policy_item.attrib:
                                                                                                                                        fullPolicyName = _getAdmlPresentationRefId(adml_data, policy_item.attrib['id'])
                                                                                                                                        if fullPolicyName:
                                                                                                                                            adm_policy_name_map[return_full_policy_names][policy_name] = fullPolicyName
                                                                                                                                            policy_name = fullPolicyName
                                                                                                                                Severity: Minor
                                                                                                                                Found in salt/modules/win_lgpo.py and 1 other location - About 55 mins to fix
                                                                                                                                salt/modules/win_lgpo.py on lines 5582..5586

                                                                                                                                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 45.

                                                                                                                                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

                                                                                                                                                try:
                                                                                                                                                    xmltree = lxml.etree.parse(adml_file)
                                                                                                                                                except lxml.etree.XMLSyntaxError:
                                                                                                                                                    # see issue #38100
                                                                                                                                                    try:
                                                                                                                                Severity: Minor
                                                                                                                                Found in salt/modules/win_lgpo.py and 1 other location - About 50 mins to fix
                                                                                                                                salt/modules/win_lgpo.py on lines 4826..4837

                                                                                                                                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 44.

                                                                                                                                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

                                                                                                                                                                if DISABLED_VALUE_XPATH(this_policy):
                                                                                                                                                                    # set the disabled value in the registry.pol file
                                                                                                                                                                    explicit_enable_disable_value_setting = True
                                                                                                                                                                    disabled_value_string = _checkValueItemParent(this_policy,
                                                                                                                                                                                                                  admPolicy,
                                                                                                                                Severity: Minor
                                                                                                                                Found in salt/modules/win_lgpo.py and 1 other location - About 50 mins to fix
                                                                                                                                salt/modules/win_lgpo.py on lines 6982..6994

                                                                                                                                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 44.

                                                                                                                                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

                                                                                                                                                                if ENABLED_VALUE_XPATH(this_policy):
                                                                                                                                                                    explicit_enable_disable_value_setting = True
                                                                                                                                                                    enabled_value_string = _checkValueItemParent(this_policy,
                                                                                                                                                                                                                 admPolicy,
                                                                                                                                                                                                                 this_key,
                                                                                                                                Severity: Minor
                                                                                                                                Found in salt/modules/win_lgpo.py and 1 other location - About 50 mins to fix
                                                                                                                                salt/modules/win_lgpo.py on lines 6866..6878

                                                                                                                                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 44.

                                                                                                                                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

                                                                                                                                                try:
                                                                                                                                                    xmltree = lxml.etree.parse(admfile, parser=parser)
                                                                                                                                                except lxml.etree.XMLSyntaxError:
                                                                                                                                                    try:
                                                                                                                                                        xmltree = _remove_unicode_encoding(admfile)
                                                                                                                                Severity: Minor
                                                                                                                                Found in salt/modules/win_lgpo.py and 1 other location - About 50 mins to fix
                                                                                                                                salt/modules/win_lgpo.py on lines 4920..4934

                                                                                                                                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 44.

                                                                                                                                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

                                                                                                                                                if value_lookup:
                                                                                                                                                    if six.text_type(v).lower() == six.text_type(item).lower():
                                                                                                                                                        log.debug('returning key %s', k)
                                                                                                                                                        return k
                                                                                                                                Severity: Minor
                                                                                                                                Found in salt/modules/win_lgpo.py and 1 other location - About 45 mins to fix
                                                                                                                                salt/modules/win_lgpo.py on lines 4658..4665

                                                                                                                                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 43.

                                                                                                                                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 set_computer_policy(name,
                                                                                                                                                        setting,
                                                                                                                                                        cumulative_rights_assignments=True,
                                                                                                                                                        adml_language='en-US'):
                                                                                                                                    '''
                                                                                                                                Severity: Minor
                                                                                                                                Found in salt/modules/win_lgpo.py and 1 other location - About 45 mins to fix
                                                                                                                                salt/modules/win_lgpo.py on lines 7814..7848

                                                                                                                                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 43.

                                                                                                                                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 set_user_policy(name,
                                                                                                                                                    setting,
                                                                                                                                                    adml_language='en-US'):
                                                                                                                                    '''
                                                                                                                                    Set a single user policy
                                                                                                                                Severity: Minor
                                                                                                                                Found in salt/modules/win_lgpo.py and 1 other location - About 45 mins to fix
                                                                                                                                salt/modules/win_lgpo.py on lines 7772..7811

                                                                                                                                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 43.

                                                                                                                                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

                                                                                                                                        if 'LsaRights' in policy_data.policies[policy_class]['policies'][policy_name]:
                                                                                                                                            ret['rights_assignment'] = True
                                                                                                                                Severity: Minor
                                                                                                                                Found in salt/modules/win_lgpo.py and 1 other location - About 35 mins to fix
                                                                                                                                salt/modules/win_lgpo.py on lines 7596..7597

                                                                                                                                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 41.

                                                                                                                                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

                                                                                                                                                if 'LsaRights' in policy_data.policies[policy_class]['policies'][pol]:
                                                                                                                                                    ret['rights_assignment'] = True
                                                                                                                                Severity: Minor
                                                                                                                                Found in salt/modules/win_lgpo.py and 1 other location - About 35 mins to fix
                                                                                                                                salt/modules/win_lgpo.py on lines 7587..7588

                                                                                                                                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 41.

                                                                                                                                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

                                                                                                                                                for policy_ns in policy_namespaces:
                                                                                                                                                    temp_ns = policy_ns
                                                                                                                                                    temp_ns = _updateNamespace(temp_ns, this_namespace)
                                                                                                                                                    policydefs_policyns_xpath(t_policy_definitions)[0].append(temp_ns)
                                                                                                                                Severity: Minor
                                                                                                                                Found in salt/modules/win_lgpo.py and 2 other locations - About 30 mins to fix
                                                                                                                                salt/modules/win_lgpo.py on lines 4853..4856
                                                                                                                                salt/modules/win_lgpo.py on lines 4939..4942

                                                                                                                                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 40.

                                                                                                                                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

                                                                                                                                                for category in categories:
                                                                                                                                                    temp_cat = category
                                                                                                                                                    temp_cat = _updateNamespace(temp_cat, this_namespace)
                                                                                                                                                    policydefs_categories_xpath(t_policy_definitions)[0].append(temp_cat)
                                                                                                                                Severity: Minor
                                                                                                                                Found in salt/modules/win_lgpo.py and 2 other locations - About 30 mins to fix
                                                                                                                                salt/modules/win_lgpo.py on lines 4868..4871
                                                                                                                                salt/modules/win_lgpo.py on lines 4939..4942

                                                                                                                                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 40.

                                                                                                                                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

                                                                                                                                                for policydefs_resource in policydefs_resources:
                                                                                                                                                    t_poldef = policydefs_resource
                                                                                                                                                    t_poldef = _updateNamespace(t_poldef, this_namespace)
                                                                                                                                                    policydef_resources_xpath(t_policy_definition_resources)[0].append(t_poldef)
                                                                                                                                Severity: Minor
                                                                                                                                Found in salt/modules/win_lgpo.py and 2 other locations - About 30 mins to fix
                                                                                                                                salt/modules/win_lgpo.py on lines 4853..4856
                                                                                                                                salt/modules/win_lgpo.py on lines 4868..4871

                                                                                                                                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 40.

                                                                                                                                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